1) What will be the output of the following program code ?
void main ( )
{
char a[]= “Hello World” ;
char *p ;
p=a;
printf(“\n%d%d%d%d”,sizeof(a), sizeof(p), stren (a), strlen(p) );
}
A] 11 11 10 10
B] 10 10 10 10
C] 12 12 11 11
D] 12 2 11 11
2) The meaning of arrow operator in a->b
A] ( *a).b
B] a.(*b)
C] a.b
D] None of these
3) What will be the output of the following program code?
void main ( )
{
printf (“\n ABC\b\b\bInfo World”);
}
A] Info world
B] ABC Info world
C] strxfrm
D] strcut
4) Which is valid string function?
A] strpbrk
B] strlen
C] strxfrm
D] strcut
5) What will be the size of following structure?
struct sample
{
static int x;
int y,z;
} ;
A] 6 bytes
B] 2 bytes
C] + bytes
D] None of these
6) Which of the following function not convert floating point number to string?
A] fcvt
B] gevt
C] eevt
D] hcvt
7) What will be the output ?
void main ( )
{
printf(“%d”,’B’ < ‘A’ );
}
A] Error
B] 1
C] 0
D] None of these
8) Which one of the following is conditional directive?
A] #nifdefn
B] #ifdefn
C] # ifdefn
D] #nifdef
9) What will be the output ?
void main ( )
{
int x;
unsigned y;
printf(“\n%d %d”, sizeof(x), sizeof(y) );
}
A] 22
B] 24
C] 44
D] None of these
10) int **x;
A] x is a pointer to pointer
B] x is not the pointer
C] x is long
D] None of these
11) What will be the output ?
void main ( )
{
printf(“\n %d %d”, 10&20, 10/ 20);
}
A] 00
B] 10 10
C] 0 30
D] 20 20
12) Which of the following is used as a string termination character?
A] 0
B] \0
C] /0
D] None of these
13) What will be the output ?
void main ( )
{
int I= 48;
printf(“\n %c %d” ,I,I );
}
A] Error
B] 48 48
C] 1 48
D] 0 48
14) A static variable by default gets initialized to
A] 0
B] blank space
C] 1
D] garbage value
15) Find out on which line no. you will get an error?
Line 1: void main ( )
Line 2: {
Line 3: print(“\n Hello World”)
Line 4: }
A] Line 1
B] Line 2
C] Line 3
D] Line 4
16) What will be the output of the following program ?
void main ( )
{
int x=10,y=20;
printf (“\n %d”,x,y);
}
A] 10
B] 20
C] 10 20
D] None of these
17) Which function reallocates memory?
A] realloc
B] alloc
C] malloc
D] None of these
18) What will be the size of following union declaration?
union Test
{
int x;
char y;
float z;
} ;
A] 7 bytes
B] 4bytes
C] 1byte
D] 4 bytes
19) A declaration float a,b; accupies ______of memory ?
A] 1 bytes
B] 4bytes
C] 8byte
D] 16 bytes
20) What is the output of the following program ?
void main()
{
int x=40;y=30;z=80;
if(x<y<z)
printf(“\n Hello world”);
else
printf(“\nGood by”);
}
A] Hello world
B]Good by
C]Compile time error
D]None of these
21) Which of the following is not a relational operator?
A]! B] != C]>= D]<
47) what will be the output ?
void main()
{
char *p=”Hello world”;
int *q;
p++;
q = (int *)p;
q++;
printf(“\n %s\n%s,p,q);
}
A] ello world
B] Error Ello world
C] ello world
D]ello world Lo world llo world
22) which of the following is an operator in ‘C’?
A] ,
B] $
C] @
D] None of these
23) What is the output of the following code?
void main()
{
int c=0, d=5,e=10,a;
A=c>1?d>1||e>1?100:200:300;
printf(“a=%d”,a);
}
A] a=300
B]a=100
C] a=200
D] None of these
24) Which among the following is an unconditional control structure?
A] do-while
B] if –else
C] goto
D] for
25) Which of the following language is the predecessor to C Programming Language?
A] A
B]B
C] BCPL
D]C++
Post A Comment:
0 comments: