R4RIN
MCQS
C/C MCQ Quiz Hub
C MCQS:-The ABC of C
Choose a topic to test your knowledge and improve your C/C skills
1. Point out which of the following variables names are valid:
variable_salary
var.
variable name
variable-sal
2. C variables are case
insensitive
Sensitive
Both of the above
None of the above
3. Binary equivalent of 762 is :-
1001111010
100000101
1011111010
1101111011
4. Octal equivalent of 762 is:-
1372
1371
7132
7312
5. A character variable can at a time store _ character(s):-
two
Infinite
three
one
6. int a,b=6; a=++b + b++; value of a ?
14
15
12
0
7. What will be the output of the following programs:- #include<stdio.h> int main() { printf("%d,%o,%x",72,72,72); }
72,110,48
72,72,72
72,58,114
72,48,144
8. What will be the output of the following programs:- #include<stdio.h> int main() { char ch; printf("%d",sizeof(ch)); }
2
3
1
4
9. What will be the output of the following programs:- #include<stdio.h> int main() { int i; printf("%d",sizeof(i)); }
Compiler error
Ascii value of i
1
4
10. What will be the output of the following programs:- #include<stdio.h> int main() { float f; printf("%d",sizeof(f)); }
Compiler error
Ascii value of f
4
1
11. What will be the output of the following programs:- #include<stdio.h> int main() { printf("%d",sizeof(char)); printf("%d",sizeof(int)); printf("%d",sizeof(float)); }
Compiler error
144
111
1
12. What will be the output of the following programs:- #include<stdio.h> int main() { printf("%d",sizeof(2)); }
1
2
4
Compiler error
13. What will be the output of the following programs:- #include<stdio.h> int main() { printf("%d",sizeof(2.0)); }
4
2
1
Compiler error
14. What will be the output of the following programs:- #include<stdio.h> int main() { float f=2.0; printf("%d,%d",sizeof(f),sizeof(2.0)); }
4,4
4,8
8,8
8,4
15. What will be the output of the following programs:- #include<stdio.h> int main() { char ch=291; printf("%d,%c",ch,ch); }
291,ch
291,#
35,#
291,291
16. What will be the output of the following program: #include<stdio.h> int main() { int a,b; a=-3- -3; b=-3- -(-3); printf("%d,%d",a,b); }
Runtime error
Compiler error
0,6
0,-6
17. What will be the output of the following program: #include<stdio.h> int main() { int a; a=3*4%5; printf("%d",a); }
12
2
0
None of the above
18. What will be the output of the following program:#include<stdio.h>int main(){int a;a=3+4-7*8/5%10;printf(
6
10
7
0
19. What will be the output of the following program: #include<stdio.h> int main() { int a; a=-3+4-7*8/5%10; printf("%d",a); }
6
10
7
0
20. What will be the output of the following program: #include<stdio.h> int main() { int a; a=4%5+6%5; printf("%d",a); return 0; }
0
5
1
None of the above
21. What will be the output of the following program: #include<stdio.h> int main() { int a; a=-3*-4%-6/-5; printf("%d",a); return 0; }
0
10
5
7
22. What will be the output of the following program: #include<stdio.h> int main() { printf("%d,",4/3); printf("%d,",4/-3); printf("%d,",-4/3); printf("%d",-4/-3); return 0; }
Compiler error
Runtime error
1,-1,-1,1
1,1,1,1
23. What will be the output of the following program: #include<stdio.h> int main() { printf("%d,",4%3); printf("%d,",4%-3); printf("%d,",-4%3); printf("%d",-4%-3); return 0; }
1,1,1,1
1,1,-1,-1
compiler error
runtime error
24. What will be the output of the following program: int main() { float a=5,b=2; int c; c=a%b; printf("%d",c); return 0; }
1
2
error
None of the above
25. What will be the output of the following program: int main() { int c; c= 3 ** 4 - 7 ^ 8; printf("%d",c); return 0; }
Error
18
2
4
26. What will be the output of the following program: int main() { float a=5.b=2; int c; c=300000*300000/300000; printf("%d",c); return 0; }
-657
657
-647
647
27. What will be the output of the following program:- int main() { float a=1.5; int b=3; a=b/2+b*8/b-b+a/3; printf("%d",a); return 0; }
6.5
6
6.5
0
28. What will be the output of the following program:- int main() { int i=3,a=4,n; float t=4.2; n=a * a / i + i / 2 * t + 2 +t; printf("%d",n) return 0; }
15
15
15
0
29. What will be the output of the following program:- int main() { int a,b; a=5.999999; b=5.000001; printf("%d,%d",a,b); return 0; }
5.999999,5.000001
5,5
0,0
None of the above
30. What will be the output of the following program:- int main() { float a; a=4/2; printf("%f,%f",a,4/2); return 0; }
2,2
2.000000,2.000000
2.0,2.0
2.000000,0.000000
31. What will be the output of the following program:- int main() { printf("%d,%f",4,4); return 0; }
4,4
4,4.000000
4,0.000000
error
32. What will be the output of the following program:- int main() { printf("%d,%f",4.0,4.0); return 0; }
4,0.000000
4,4
4,4.000000
4.0,4.0
33. What will be the output of the following program:- int main() { printf("%d",sizeof(4)/sizeof(2.0)); return 0; }
1
0
2
error
34. What will be the output of the following program:- int main() { printf("%d",sizeof(4.0)/sizeof(4)); return 0; }
0
1
2
Error
35. What will be the output of the following program,consider 10 as a input:- int main() { scanf("%d",&n); printf("%d",n); return 0; }
10
4
Error:undefined Symbol n
None of the above
36. What will be the output of the following program:- int main() { int a=5,x; x=++a + a++ - ++a; printf("%d",a); return 0; }
7
5
8
6
37. What will be the output of the following program:- int main() { int a=5,x; x=++a + a++ - ++a; x++; a=a + ++x; printf("%d",a); return 0; }
17
5
12
13
38. What will be the output of the following program:- int main() { int a=5,x; x=++a + a++ + ++a; printf("%d,%d",x,a);}
15,5
15,8
18,7
21,8
39. What will be the output of the following program:- int main() { int a=5,x; x=++a * a++; printf("%d,%d",x,a); return 0; }
36,7
25,7
25,6
25,5
40. Binary representation of 345 is :-
101010001
110011001
1011111001
101011001
41. Decimal representation of 101011001 is :-
347
276
325
345
42. Decimal representation of 101010001 is :-
317
345
337
None of the above
43. Decimal representation of 110011001 is :-
317
409
512
None of the above
44. Decimal representation of 11111001 is :-
249
261
256
None of the above
45. Decimal representation of 11111111 is :-
256
257
255
None of the above
46. Octal representation of 11111001 is :-
79
371
234
None of the above
47. Hexadecimal representation of 11111001 is :-
E9
99
F9
159
48. Binary representation of F9 is :-
11111001
11100110
11001001
11100110
49. Binary representation of 371(octal) is :-
11111001
11110010
11110011
10111011
Submit