

MCQOPTIONS
Saved Bookmarks
This section includes 72 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. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | M |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
2. |
What will be the output of this program?
|
A. | Given integer 'P' with 'true' :20 |
B. | Given integer 'P' with 'true' :0 |
C. | Given integer 'P' with 'true' :2 |
D. | All of above |
E. | None of these |
Answer» B. Given integer 'P' with 'true' :0 | |
3. |
What is the output of the following program?
|
A. | 143.0f |
B. | Compilation Error |
C. | Runtime Error |
D. | 143 |
E. | None of these |
Answer» E. None of these | |
4. |
What is the output of this program?
|
A. | 0.20000000000000001 |
B. | 0.2000000001 |
C. | 0.200 |
D. | 2.20000000000000001 |
E. | None of these |
Answer» B. 0.2000000001 | |
5. |
What is the output of this program?
|
A. | Interview |
B. | Mania |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» C. Compilation Error | |
6. |
What would be the output of the following program (in 32-bit systems)?
|
A. | 1 4 4 |
B. | 4 4 1 |
C. | 4 1 4 |
D. | Garbage value |
E. | None of these |
Answer» B. 4 4 1 | |
7. |
What is the output of the following program?
|
A. | 10 2 |
B. | 10 4 |
C. | 2 10 |
D. | 10 0 |
E. | 4 10 |
Answer» F. | |
8. |
What is the output of the following program?
|
A. | 0x10 + 030 + 50 |
B. | 030 + 50 |
C. | 0x10 + 030 |
D. | Depends on compiler |
E. | Garbage |
Answer» E. Garbage | |
9. |
What is the output of this program?
|
A. | 31 |
B. | Runtime Error |
C. | Compile time Error |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
10. |
What does the following statement mean?
|
A. | declares a variable with value a |
B. | flags an error |
C. | a is an object of type void |
D. | variable a is of type void |
E. | None of these |
Answer» C. a is an object of type void | |
11. |
What is the output of this program?
|
A. | 456789 |
B. | 0123456789101112 |
C. | 0123456 |
D. | 89101112 |
E. | Compilation Error |
Answer» B. 0123456789101112 | |
12. |
What constant defined in
|
A. | SIZE_CHAR |
B. | CHAR_SIZE |
C. | CHAR_BIT |
D. | BIT_CHAR |
E. | None of these |
Answer» D. BIT_CHAR | |
13. |
What is the output of this program?
|
A. | Interview |
B. | Mania |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» C. Compilation Error | |
14. |
Pick the right option
|
A. | Statement (i) is true, Statement (i) is false |
B. | Statement (i) is true, Statement (ii) is false |
C. | Both are true |
D. | Both are false |
E. | None of these |
Answer» E. None of these | |
15. |
Which of the given statements are false.
|
A. | (ii), (iii) and (iv) |
B. | (iii) and (iv) only |
C. | (ii) and (iii) only |
D. | only (iv) |
E. | None of these |
Answer» E. None of these | |
16. |
Pick the right option
|
A. | Statement (ii) is true, Statement (i) is false |
B. | Statement (i) is true, Statement (ii) is false |
C. | Both are true |
D. | Both are false |
E. | None of these |
Answer» B. Statement (i) is true, Statement (ii) is false | |
17. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage Value |
D. | All of above |
E. | None of these |
Answer» B. Runtime Error | |
18. |
Choose the correct option.
|
A. | (i) declares and defines k, (ii) declares k |
B. | both (i) and (ii) declare k |
C. | (i) declares k, (ii) declares and defines k |
D. | (i) declares the variable k and (ii) defines k |
E. | None of these |
Answer» D. (i) declares the variable k and (ii) defines k | |
19. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage Value |
D. | hotstar |
E. | None of these |
Answer» B. Runtime Error | |
20. |
What is the output of this program?
|
A. | male |
B. | female |
C. | transgender |
D. | All of above |
E. | 012 |
Answer» F. | |
21. |
What is the output of this program?
|
A. | 20 21 |
B. | 21 22 |
C. | 20 21 22 |
D. | 20 22 |
E. | None of these |
Answer» D. 20 22 | |
22. |
What is the output of this program?
|
A. | If you were boy, you would be 5 |
B. | If you were boy, you would be 0 |
C. | If you were boy, you would be 10 |
D. | All of above |
E. | None of these |
Answer» B. If you were boy, you would be 0 | |
23. |
What is the value of the following 8-bit integer after all statements are executed?
|
A. | Implementation defined |
B. | -1 |
C. | 127 |
D. | 1 |
E. | None of these |
Answer» B. -1 | |
24. |
What will be output of this function?
|
A. | Compilation Error |
B. | Runtime Error |
C. | 15 |
D. | 10 |
E. | None of these |
Answer» D. 10 | |
25. |
What will be output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | 0 5 |
D. | 5 0 |
E. | None of these |
Answer» D. 5 0 | |
26. |
What is the output of the following program?
|
A. | 10 |
B. | 20 |
C. | a is greater |
D. | b is greater |
E. | None of these |
Answer» D. b is greater | |
27. |
Choose the right option
|
A. | q is a pointer to a string, p is a string |
B. | both p and q are pointers to string types |
C. | p is a pointer to a string, q is a string |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
28. |
Identify the incorrect statements.
|
A. | Statement (ii) and (iii) are wrong |
B. | Statement (i) and (iii) are wrong |
C. | Statement (i) and (ii) are wrong |
D. | All the three are wrong |
E. | None of these |
Answer» C. Statement (i) and (ii) are wrong | |
29. |
What is the output of this program?
|
A. | 0123 |
B. | 123 |
C. | 234 |
D. | 012345 |
E. | 01234 |
Answer» D. 012345 | |
30. |
What will be the output of this program?
|
A. | 0 |
B. | 65 |
C. | A |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
31. |
What is the value of the bool?
|
A. | 0 |
B. | 1 |
C. | True |
D. | False |
E. | None of these |
Answer» E. None of these | |
32. |
Select the right option.
|
A. | i is false and ii is true |
B. | i is true but ii is false |
C. | both i and ii are false |
D. | both i and ii are true |
E. | None of these |
Answer» E. None of these | |
33. |
Evaluate the following
|
A. | true |
B. | false |
C. | 0 |
D. | 1 |
E. | None of these |
Answer» E. None of these | |
34. |
Which of the following statements are true?
|
A. | n is a function taking an argument of type float and returning an integer |
B. | n is a function of type float |
C. | n is a function taking an argument of type int and returning a floating point number |
D. | All of above |
E. | None of these |
Answer» B. n is a function of type float | |
35. |
What is the value of p?
|
A. | 16 |
B. | 15 |
C. | 10 |
D. | All of above |
E. | None of these |
Answer» B. 15 | |
36. |
What is the output of the following program?
|
A. | 6 |
B. | 12 |
C. | 74 |
D. | 50 |
E. | None of these |
Answer» D. 50 | |
37. |
What would be the output of the following program (in 32-bit systems)? |
A. | 1 4 4 |
B. | 4 4 1 |
C. | 4 1 4 |
D. | Garbage value |
E. | None of these |
Answer» B. 4 4 1 | |
38. |
The size of an object or a type can be determined using which operator? |
A. | sizeof |
B. | malloc |
C. | calloc |
D. | malloc |
E. | None of these |
Answer» B. malloc | |
39. |
Which of the following will not return a value? |
A. | void |
B. | free |
C. | null |
D. | empty |
E. | None of these |
Answer» D. empty | |
40. |
Which variable does equals in size with enum variable? |
A. | string variable |
B. | int variable |
C. | float variable |
D. | All of above |
E. | None of these |
Answer» C. float variable | |
41. |
What will happen when defining the enumerated type? |
A. | it will not allocate memory to its variables |
B. | it will not allocate memory |
C. | it will allocate memory |
D. | All of above |
E. | None of these |
Answer» C. it will allocate memory | |
42. |
To which of these enumerators can be assigned? |
A. | negative |
B. | enumerator |
C. | integer |
D. | All of above |
E. | None of these |
Answer» E. None of these | |
43. |
In which type do the enumerators are stored by the compiler? |
A. | integer |
B. | float |
C. | string |
D. | All of these |
E. | None of these |
Answer» B. float | |
44. |
Can two functions declare variables(non static) with the same name. |
A. | Yes |
B. | No |
C. | No, it gives a runtime error |
D. | Yes, but not a very efficient way to write programs |
E. | None of these |
Answer» E. None of these | |
45. |
Which of the given statements are false. |
A. | (ii), (iii) and (iv) |
B. | (iii) and (iv) only |
C. | (ii) and (iii) only |
D. | only (iv) |
E. | None of these |
Answer» E. None of these | |
46. |
Pick the right option |
A. | Statement (ii) is true, Statement (i) is false |
B. | Statement (i) is true, Statement (ii) is false |
C. | Both are true |
D. | Both are false |
E. | None of these |
Answer» B. Statement (i) is true, Statement (ii) is false | |
47. |
Which is correct with respect to size of the data types? |
A. | char < int < double |
B. | char < int < float |
C. | int < char > float |
D. | char > int < float |
E. | None of these |
Answer» B. char < int < float | |
48. |
Which is used to indicate single precision value? |
A. | L or l |
B. | F or f |
C. | Neither F or for L or l |
D. | Either F or for L or l |
E. | None of these |
Answer» C. Neither F or for L or l | |
49. |
Choose the right option |
A. | q is a pointer to a string, p is a string |
B. | both p and q are pointers to string types |
C. | p is a pointer to a string, q is a string |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
50. |
The operator used for dereferencing or indirection is ____ |
A. | >> |
B. | & |
C. | * |
D. | -> |
E. | None of these |
Answer» D. -> | |