(Int Const P 5 Printf ("%D",++ ( P) ) )
(Int Const P 5 Printf ("%D",++ ( P) ) )
2. void main()
3. main()
4. main()
5. main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++) { printf(" %d ",*p); ++p; } }
a. b. c. d. 2.8 3.4 4 6.7 5 2.8 3.4 4 6.7 5 2.8 2.8 2.8 2.8 . Infinite times 2222223465 Error
9. main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
a. b. c. d. zero one zero three three Error
10. #include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }t1; struct xx *s; s=&t1; printf("%d",s->x); printf("%s",s->name); }
a. b. c. d. 3 Garbage Value Grabage Value hello 3 hello Error
14. void main() { printf(sizeof (void *) = %d \n, sizeof( void *)); printf(sizeof (int *) = %d \n, sizeof(int *)); printf(sizeof (double *) = %d \n, sizeof(double *)); printf(sizeof(struct unknown *) = %d \n, sizeof(struct unknown *)); }
a. b. c. d. 1111 2222 0281 Error
15. main() {
16. What is the return type of printf() function? a. void b. int c. char d. double 17. struct a { int x ; struct a *b; } a. Nested Structure b. Anonymous Structure c. Self referential Structure d. None of the above. 18 main() { float i=1.5; switch(i) { case 1.5: printf("1"); case 2.5: printf("2"); default : printf("0"); } }
a. b. c. d. 1 12 120 Error
19. main()
a. b. c. d.
2 -2 0 1
20. main()
21. #include<stdio.h>
int main(){ int a=0; #if (a==0) printf("Equal"); #else if printf("Not equal"); #endif return 0; }
(A) Equal (B) Not equal (C) Null (D) Garbage (E) Compilation error 22.What will be output if you will execute following c code?
printf("cquestionbank"); return 0; }
(A) Cquestionbank (B) bank (C) C (D) Infinite loop (E) blank space
#include<stdio.h> int main(){ int x=25; if(!!x) printf("%d",!x); else printf("%d",x); return 0; }
(A) 0 (B) 25 (C) 1 (D) -1 (E) 2 24.What will be output if you will execute following c code?
#include<stdio.h> int main(){ float a=0.5, b=0.9; if(a&&b>0.9) printf("Sachin"); else printf("Rahul"); return 0; }
(A) Sachin (B) Rahul (C) null
(D) Run time error (E) Compilation error 25.What will be output if you will execute following c code?
#include<stdio.h> int main(){ int x=5, y=10; if(!(!x) && x) printf("%d",x); else printf("%d",y); return 0 ; }
(A) 1 (B) 0 (C)
#include<stdio.h> int main(){ int a,b; a = -3- -3; b = -3 - - (-3 ); printf("%d %d",a,b);
return 0 ;
(A) 0 0 (B) 0 -3 (C) -3 0 (D) 0 -6 (E) Compilation error ans 82.What will be output if you will execute following c code?
#include<stdio.h> int main(){ int x=3, y=4, z=4; printf("%d", (z>=y>=x?100:200)); } return 0 ;
#include<stdio.h> int main(){ int a=30, b=40, x; x=(a!=10) && (b=50); printf("%d",x); return 0 ; }
(A) 1 (B)
(C) 3 (D) 4 (E) Compilation error 31.What will be output if you will execute following c code?
#include<stdio.h> int main(){ float x=12.25, y=13.65; if(x=y) printf("x and y are equal"); else printf("x and y are not equal"); return 0 ; } (A) x and y are equal
(B) x and y are not equal (C) It will print nothing (D) Run time error (E) Compilation error 32.What will be output if you will execute following c code?
#include<stdio.h> int main(){ int i=1, j=1; for(;j;printf("%d%d\t",i,j)) j=i++ <= 5; return 0 ; }
(A) 1 2 3 4 5
(B) 11 12 13 14 (C) 21 31 41 51 61 70 (D) Infinite loop (E) Compilation error 33.What function is used to release the allocated memory space? (A) deallocate() (B) release () (C) free () (D) drop() (E) empty ()
#include<stdio.h> auto int a=5; int main(){ int x; x=~a+a&a+a<<a; printf("%d",x); return 0; }
(A)
(B) 1 (C) 154 (D) 155 (E) Compilation error 35.What will be output if you will execute following c code?
#include<stdio.h> void main(){ int a=5; { int b=10; ++b; ++a; { int a=20; ++a;
} printf(" %d",a);
13 5
(E) Compilation error 36.What will be output if you will execute following c code?
#include<stdio.h> #include<conio.h> void main(){ int a[]={0,1,2,3,4,5,6,7,8,9,10}; int i=0,num; num=a[++i+a[++i]]+a[++i]; printf("%d",num); }
(A) 6 (B) 7 (C) 8 (D) 9 (E) Compilation error 37.What will be output if you will execute following c code?
#include<stdio.h> #include<conio.h> void main(){ int i=3,val; val=sizeof f(i)+ +f(i=1)+ +f(i-1); printf("%d %d",val,i); } int f(int num){ return num*5; }
num=-a--; printf("%d }
(A) 5
%d",num,a);