

MCQOPTIONS
Saved Bookmarks
This section includes 44 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
The expression of the right hand side of operators doesn't get evaluated if the left hand side determines the outcome. |
A. | True |
B. | False |
Answer» B. False | |
2. |
In the expression the order of Assignment is NOT decided by Associativity of operators |
A. | True |
B. | False |
Answer» C. | |
3. |
Are the following two statement same? |
A. | Yes |
B. | No |
Answer» C. | |
4. |
Will the expression be disallowed by the compiler? |
A. | Yes |
B. | No |
Answer» C. | |
5. |
Which of the following is the correct order of evaluation for the below expression? |
A. | * / % + - = |
B. | = * / % + - |
C. | / * % - + = |
D. | * % / - + = |
Answer» B. = * / % + - | |
6. |
In which order do the following gets evaluated |
A. | 2134 |
B. | 1234 |
C. | 4321 |
D. | 3214 |
Answer» B. 1234 | |
7. |
Which of the following is the correct order if calling functions in the below code? |
A. | f1, f2, f3 |
B. | f3, f2, f1 |
C. | Order may vary from compiler to compiler |
D. | None of above |
Answer» D. None of above | |
8. |
Which of the following are unary operators in C? |
A. | 1, 2 |
B. | 1, 3 |
C. | 2, 4 |
D. | 1, 2, 3 |
Answer» E. | |
9. |
What will be the output of the program?_x000D_
#include
|
A. | 1, 1, 1, 1 |
B. | 1, 1, 0, 1 |
C. | 1, 0, 0, 1 |
D. | 1, 0, 1, 1 |
Answer» E. | |
10. |
What will be the output of the program?_x000D_
#include
|
A. | z=0 |
B. | z=1 |
C. | z=4 |
D. | z=2 |
Answer» C. z=4 | |
11. |
What will be the output of the program?_x000D_
#include
|
A. | c=100 |
B. | c=200 |
C. | c=1 |
D. | c=300 |
Answer» D. c=300 | |
12. |
What will be the output of the program?_x000D_
#include
|
A. | 4 |
B. | 7 |
C. | 6 |
D. | 5 |
Answer» C. 6 | |
13. |
What will be the output of the program?_x000D_
#include
|
A. | 2, 2, 0, 1 |
B. | 1, 2, 1, 0 |
C. | -2, 2, 0, 0 |
D. | -2, 2, 0, 1 |
Answer» E. | |
14. |
What will be the output of the program?_x000D_
#include
|
A. | 1, 2, 0, 1 |
B. | -3, 2, 0, 1 |
C. | -2, 3, 0, 1 |
D. | 2, 3, 1, 1 |
Answer» D. 2, 3, 1, 1 | |
15. |
What will be the output of the program?_x000D_
#include
|
A. | -2, 3, 1, 1 |
B. | 2, 3, 1, 2 |
C. | 1, 2, 3, 1 |
D. | 3, 3, 1, 2 |
Answer» B. 2, 3, 1, 2 | |
16. |
Which of the following is the correct order if calling functions in the below code?_x000D_ a = f1(23, 14) * f2(12/4) + f3(); |
A. | f1, f2, f3 |
B. | f3, f2, f1 |
C. | Order may vary from compiler to compiler |
D. | None of above |
Answer» D. None of above | |
17. |
What will be the output of the program?
#include
|
A. | 4 |
B. | 7 |
C. | 6 |
D. | 5 |
Answer» C. 6 | |
18. |
What will be the output of the program?
#include
|
A. | 1, 2, 0, 1 |
B. | -3, 2, 0, 1 |
C. | -2, 3, 0, 1 |
D. | 2, 3, 1, 1 |
Answer» D. 2, 3, 1, 1 | |
19. |
What will be the output of the program?
#include
|
A. | 3 |
B. | 4 |
C. | 5 |
D. | 6 |
Answer» C. 5 | |
20. |
What will be the output of the program?
#include
|
A. | 4, 3, 3 |
B. | 4, 3, 2 |
C. | 3, 3, 2 |
D. | 2, 3, 3 |
Answer» E. | |
21. |
What will be the output of the program?
#include
|
A. | The letter is aNow the letter is A |
B. | The letter is ANow the letter is a |
C. | Error |
D. | None of above |
Answer» B. The letter is ANow the letter is a | |
22. |
What will be the output of the program?
#include
|
A. | c=100 |
B. | c=200 |
C. | c=1 |
D. | c=300 |
Answer» D. c=300 | |
23. |
What will be the output of the program?
#include
|
A. | 200 |
B. | 30 |
C. | 100 |
D. | 500 |
Answer» C. 100 | |
24. |
What will be the output of the program?
#include
|
A. | 3, 4 |
B. | 4, 3 |
C. | 4, 4 |
D. | Output may vary from compiler to compiler |
Answer» E. | |
25. |
The expression of the right hand side of || operators doesn't get evaluated if the left hand side determines the outcome. |
A. | 1 |
B. | |
Answer» B. | |
26. |
Two different operators would always have different Associativity. |
A. | Yes |
B. | No |
Answer» C. | |
27. |
Will the expression *p = p be disallowed by the compiler? |
A. | Yes |
B. | No |
Answer» C. | |
28. |
What will be the output of the program?
#include
|
A. | 1, 0, 1 |
B. | 1, 1, 1 |
C. | 0, 0, 0 |
D. | 0, 1, 0 |
Answer» D. 0, 1, 0 | |
29. |
What will be the output of the program?
#include
|
A. | z=0 |
B. | z=1 |
C. | z=4 |
D. | z=2 |
Answer» C. z=4 | |
30. |
What will be the output of the program?
#include
|
A. | 2, 2, 0, 1 |
B. | 1, 2, 1, 0 |
C. | -2, 2, 0, 0 |
D. | -2, 2, 0, 1 |
Answer» E. | |
31. |
Every operator has an Associativity |
A. | Yes |
B. | No |
Answer» B. No | |
32. |
What will be the output of the program?
#include
|
A. | 1, 40, 1 |
B. | 1, 55, 1 |
C. | 1, 55, 0 |
D. | 1, 1, 1 |
Answer» B. 1, 55, 1 | |
33. |
Associativity of an operator is either Left to Right or Right to Left. |
A. | 1 |
B. | |
Answer» B. | |
34. |
In the expression a=b=5 the order of Assignment is NOT decided by Associativity of operators |
A. | 1 |
B. | |
Answer» C. | |
35. |
What will be the output of the program?
#include
|
A. | 1, 1, 1, 1 |
B. | 1, 1, 0, 1 |
C. | 1, 0, 0, 1 |
D. | 1, 0, 1, 1 |
Answer» E. | |
36. |
Assuming, integer is 2 byte, What will be the output of the program?
#include
|
A. | ffff |
B. | 0   |
C. | fff8 |
D. | Error |
Answer» D. Error | |
37. |
What will be the output of the program?
#include
|
A. | -2, 3, 1, 1 |
B. | 2, 3, 1, 2 |
C. | 1, 2, 3, 1 |
D. | 3, 3, 1, 2 |
Answer» B. 2, 3, 1, 2 | |
38. |
In which order do the following gets evaluated 1. Relational 2. Arithmetic 3. Logical 4. Assignment |
A. | 2134 |
B. | 1234 |
C. | 4321 |
D. | 3214 |
Answer» B. 1234 | |
39. |
Are the following two statement same? 1. a <= 20 ? (b = 30): (c = 30); 2. (a <=20) ? b : (c = 30); |
A. | Yes |
B. | No |
C. | Yes |
D. | No |
Answer» C. Yes | |
40. |
Which of the following are unary operators in C? 1. ! 2. sizeof 3. ~ 4. && |
A. | 1, 2 |
B. | 1, 3 |
C. | 2, 4 |
D. | 1, 2, 3 |
Answer» E. | |
41. |
Which of the following is the correct usage of conditional operators used in C? |
A. | a>b ? c=30 : c=40; |
B. | a>b ? c=30; |
C. | max = a>b ? a>c?a:c:b>c?b:c |
D. | return (a>b)?(a:b) |
Answer» D. return (a>b)?(a:b) | |
42. |
Associativity has no role to play unless the precedence of operator is same. |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» B. | |
43. |
Which of the following is the correct order if calling functions in the below code? a = f1(23, 14) * f2(12/4) + f3(); |
A. | f1, f2, f3 |
B. | f3, f2, f1 |
C. | Order may vary from compiler to compiler |
D. | None of above |
Answer» D. None of above | |
44. |
Which of the following is the correct order of evaluation for the below expression?z = x + y * z / 4 % 2 - 1 |
A. | * / % + - = |
B. | = * / % + - |
C. | / * % - + = |
D. | * % / - + = |
Answer» B. = * / % + - | |