C MCQ Set2
C MCQ Set2
Void main()
int a=25;
clrscr();
printf(“%o%x”,a,a);
getch();
A. 25 25
B. 025 0X25
C. 12 42
D. 31 19
Q56. What will be the value of ‘a’ after the following code is executed
#define square(x) x x
a=square(2+3)
A. 25
B. 13
C. 11
D. 10
Printf(“%d%d”,sizeof(*x),sizeof(x));
A. 88
B. 18
C. 29
D. 19
Q58.
#include<stdio.h>
Int main()
Int a=10,b=2,c;
A=!(c=c==c)&&++b;
C+=(a+b--);
Printf(“%d %d %d”,b,c,a);
Return 0;
A. 230
B. 2 13 0
C. 130
D. 234
int a=5,b=6,c=9,d;
d=a>b?(a>c?1:2):(c>b?6:8));
printf(“%d”,d);
A. 1
B. 2
C. 6
D. Error
int i=3;
printf(“%d%d”,i,i++);
A. 34
B. 43
C. 44
D. 33
Int i=3;
Printf(“%d%d%d”,i++,I,++i);
A. 345
B. 444
C. 445
D. 344
Int i=3;
Printf(“%d%d%d”,--i,I,i--,i++);
A. 2343
B. 2232
C. 2221
D. 2233
Q63.
Int y[4]={6,7,8,9};
Int *ptr=y+2;
Printf(“%d\n”,ptr[1]);
A. 6
B. 7
C. 8
D. 9
Void main()
If(printf(“cquestationbank”));
Else
A. I know c
B. I know c++
C. cquestationbankI know c
D. cquestationbankI know c++
Q65.
#define call(x) #x
Void main()
Printf(“%s”,call(c/c++));
A. c
B. c++
C. #c/c++
D. c/c++
Q66.what will be output if you will compile and execute the following code?
void main()
clrscr();
printf(“%s”,mesege);
getch();
A. union is \power of c
B. union is power of c
C. union is Power of c
D. compiler error
Q67.
void main()
{ int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf(“%d”,a+b);
getch();
A. 3
B. 21
C. 17
D. 7
Q68.
Void main()
Int i=0;
If(i==0)
i=((5,(i=3)),i=1);
printf(“%d”,i);}
else
printf(“equal”);
A. 5
B. 3
C. 1
D. Equal
Q69.
Void main()
{ static main();
Int x;
x=call(main);
printf(“%d”,x);
getch();
{ address++;
return address;
A. 0
B. 1
C. GARBAGE VALUE
D. COMPILER ERROR
Q70.
#include”string.h”
void main()
{
printf(“%d%d”,sizeof(“string”),strlen(“string”));
getch();
A. 66
B. 77
C. 67
D. 76
Q71.
Struct marks
{ int p:3;
int c:3;
int m:2;
};
Void main()
Printf(“%d%d%d”,s.p,s.c,s.m);
A. 2 -6 5
B. 2 -6 1
C. 221
D. Compiler Error
Q72.
Int extern x;
Void main()
printf(“%d”,x);
x=2;
getch();
Int x=23;
A. 0
B. 2
C. 23
D. Compiler error
Q73.
#include<stdio.h>
Int main()
Int a[5]={1,2,3,4,5};
int I;
for(i=0;i<5;i++)
if((char)a[i]==’5’)
printf(“%d\n”,a[i]);
else
printf(“FAIL\n”);
Q74.
#include<stdio.h>
Int main()
Enum{ORANGE5,MANGO,BANANA=4,PEACH};
Printf(“PEACH=%d\n”,PEACH);
A. PEACH=3
B. PEACH=4
C. PEACH=5
D. PEACH=6
Q75.
#include<stdio.h>
Int main()
int c;
c=printf(“%d”,printf(“%d”,printf(“1234”)));
return 0;
A. 123434
B. 123441
C. Compile time error
D. 123444
Q76.
#include<stdio.h>
Int main()
Int a,b,c;
Printf(“%d”,c);
Return 0;
A. 5
B. 6
C. Compile time error
D. 2
Q77.
#include<stdio.h>
Int main()
Int a,b,c;
printf(“%d”,c);
return 0;
A. hai 24
B. hai22
C. compiler time error
D. hai 34
Q78.
#include<stdio.h>
Void main()
int x=1,y=Q,z=5;
printf(“%d”,z);
A. 6
B. 5
C. 0
D. Varies
Q79.
#include<stdio.h>
Void main()
Int x=1,z=3;
Int y=x<<3;
Printf(“%d\n”,y);
A. -2147483648
B. -1
C. Run time error
D. 8
Q80.
#include<stdio.h>
Int main()
Int i=0,j=0;
//do something
Printf(“%d”,j);
A. 0
B. 10
C. Compiler error
D. 11
Q81.
#include<stdio.h>
Int main()
Int i=1;
If(i++ &&(i==1))
Printf(“Yes\n”);
Else
Printf(“No\n”);
A. Yes
B. No
C. Depends on the compiler
D. Depends on the standard
Q82.
#include<stdio.h>
Int main()
Int a=1,b=1,c;
c=a++ +b;
printf(“%d,%d”,a,b);
A. A=1, b=1
B. a=2, b=1
C. a=1, b=2
D. a=2, b=1
Q83.
#include<stdio.h>
Int main()
Int a=10,b=10;
If(a=5)
b--;
printf(“%d%d”,a,b--);
A. a=10,b=9
B. a=10,b=8
C. a=5,b=9
D. a=15,b=8
Q84.
#include<stdio.h>
Int main()
Int x=2,y=0;
Printf(“%d\n”,z);
Return 0;
A. 0
B. 1
C. undifind behavior
D. compile time error
Q85.
#include<stdio.h>
Int main()
int y=1,x=0;
int l=(y++,x++)?y:x;
printf(“%d\n”,l);
A. 1
B. 2
C. Compile time error
D. Undefined behavior
Q.86
#include<stdio.h>
Int main()
Int j=10;
Printf(“%d\n”,j++);
Return 0;
A. 10
B. 11
C. Compile time error
D. 0
Q87.
Void main()
Int i=10;
printf(“Equal”);
Elseif(x>i)
printf(“Greater than”);
Else
printf(“Less than”);
A. Equal
B. Gretter than
C. Less than
D. Compiler error
Q89.
#include<stdio.h>
Int main()
float x=’a’;
printf(“%f”,x);
return 0;
A. A
B. Run time error
C. a.0000000
D. 97.000000
Q90.
#include<stdio.h>
Int main()
float x=’a’;
printf(“%f”,x);
return 0;
}
A. A
B. Run time error
C. a.0000000
D. 97.000000
Q91.
#include<stdio.h>
Int main()
Char p;
char b[10]={1,2,3,4,5,6,9,8};
p=(b+1)[5];
printf(“%d”,p);
return o;
A. 5
B. 6
C. 9
D. None of above
Q92.
Int main()
Char p[]=”csegurus”;
Char t;
Int i,j;
For(i=0,j=strlen(p);i<j;i++)
t=p[i];
p[i]=p[j-1];
p[j-1]=t;
Printf(“%s”,p);
return 0;
A. guruscse
B. Nothing is printed on the screen
C. csegurus
D. gggggggg