Programming Language - C Aptitude Multiple Choice Questions...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: C Aptitude Multiple Choice Questions and Answers 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 statement ? printf("%X%x%ci%x",11,10,'s',12); a) error b) basc c) Bas94c d) none of these Q4. 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 Q 5. What will be the output of the following statements ? int a = 5, b = 2, c = 10, i = a>b void main() { printf("hello"); main(); } a) 1 b) 2 c) infinite number of times d) none of these Q7. What will be the output of the following statements ? int x[4] = {1,2,3}; printf("%d %d %D",x[3],x[2],x[1]); a) 03%D b) 000 c) 032 d) 321 Q8. What will be the output of the following statement ? printf( 3 + "goodbye"); a) goodbye b) odbye c) bye d) dbye Q9. What will be the output of the following statements ? long int a = scanf("%ld%ld",&a,&a); printf("%ld",a); a) error b) garbage value c) 0 d) 2 Q10. 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 Q11. 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 Q12. What will be the output of following program ? #include main() { int x,y = 10; x = y * NULL; printf("%d",x); } a) error b) 0 c) 10 d) garbage value Q13. What will be the output of following statements ? char x[ ] = "hello hi"; printf("%d%d",sizeof(*x),sizeof(x)); a) 88 b) 18 c) 29 d) 19 Q14. 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 Q15. What will be the output of the following statements ? int i = 3; printf("%d%d",i,i++); a) 34 b) 43 c) 44 d) 33 Q16. What will be the output of the following program ? #include void main() { int a = 36, b = 9; printf("%d",a>>a/b-2); } a) 9 b) 7 c) 5 d) none of these Q17) int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; What value does testarray[2][1][0] in the sample code above contain? a) 11 b) 7 c) 5 d) 9 Q18) void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } What is the output? 1) XAM is printed 2) exam is printed 3) Compiler Error 4) Nothing is printed Q19) What is the output of the following code?...
View Full Document

This note was uploaded on 08/08/2011 for the course CS 101 taught by Professor Jitenderkumarchhabra during the Summer '11 term at National Institute of Technology, Calicut.

Page1 / 33

Programming Language - C Aptitude Multiple Choice Questions...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online