Sei sulla pagina 1di 2

Q1. What will be the output of the following arithmetic expression ? 5+3*2%10-8*6 a) -37 b) -42 c) -32 d) -28 Q2.

What will be the output of the following statement ? int a=10; printf("%d &i",a,10); a) error b) 10 c) 10 10 d) none of these Q3. What will be the output of the following statements ? int a = 4, b = 7,c; c = a = = b; printf("%i",c); a) 0 b) error c) 1 d) garbage value Q4. What will be the output of the following statement ? printf( 3 + "goodbye"); a) goodbye b) odbye c) bye d) dbye Q5. What will be the output of the following program ? #include void main() { int a = 2; switch(a) { case 1: printf("goodbye"); break; case 2: continue; case 3: printf("bye"); } } a) error b) goodbye c) bye d) byegoodbye Q6. What will be the output of the following statements ? int i = 1,j; j=i--- -2; printf("%d",j); a) error b) 2 c) 3 d) -3

Q7. What will be the output of the following statements? int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf("%d",d); a) 1 b) 2 c) 6 d) 8 Q8) What is the output? void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } 1) XAM is printed 2) exam is printed 3) Compiler Error 4) Nothing is printed Q9) What would be the output of the following program? #include main() { char str[]="S\065AB"; printf("\n%d", sizeof(str)); } 1) 7 2) 6 3) 5 4) error

Potrebbero piacerti anche