

MCQOPTIONS
Saved Bookmarks
This section includes 70 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.
51. |
What will be the output of the following program?
#include
|
A. | 0 |
B. | 5 |
C. | 100 |
D. | -5 |
Answer» C. 100 | |
52. |
What will be the output of the following program?
#include
|
A. | The program will print the output M = 130. |
B. | The program will print the output M = 195. |
C. | The program will print the output M = -21. |
D. | The program will print the output M = -61. |
Answer» E. | |
53. |
Which of the following statement is correct about the program given below?
#include
|
A. | The program will print the output 0. |
B. | The program will print the output 10. |
C. | The program will print the output 30. |
D. | The program will print the output 40. |
Answer» B. The program will print the output 10. | |
54. |
Which of the following statement is correct about the program given below?
#include
|
A. | The program will print the output 1. |
B. | The program will print the output 24. |
C. | The program will print the output 120. |
D. | The program will print the output garbage value. |
Answer» C. The program will print the output 120. | |
55. |
What will be the output of the following program?
#include
|
A. | 8 |
B. | 6 |
C. | -6 |
D. | -8 |
Answer» D. -8 | |
56. |
What will be the output of the following program?
#include
|
A. | Java Programming! |
B. | C++ Programming! |
C. | Learn C++ Programming! |
D. | Learn Java Programming! |
Answer» E. | |
57. |
Which of the following function declaration is/are incorrect? |
A. | int Sum(int a, int b = 2, int c = 3); |
B. | int Sum(int a = 5, int b); |
C. | int Sum(int a = 0, int b, int c = 3); |
D. | Both B and C are incorrect. |
Answer» E. | |
58. |
Which of the following function / type of function cannot be overloaded? |
A. | Member function |
B. | Static function |
C. | Virtual function |
D. | Both B and C |
Answer» D. Both B and C | |
59. |
Which of the following statement is correct about the program given below?
#include
|
A. | The program will print the output 0. |
B. | The program will print the output 1. |
C. | The program will print the output 2. |
D. | The program will print the output garbage value. |
Answer» D. The program will print the output garbage value. | |
60. |
Which of the following statement is correct about the program given below?
#include
|
A. | The program will print the output 10 20. |
B. | The program will print the output 10 0. |
C. | The program will print the output 10 garbage. |
D. | The program will report compile time error. |
Answer» B. The program will print the output 10 0. | |
61. |
Which of the following statement is correct about the program given below?
#include
|
A. | The program will print the output 1 0 3. |
B. | The program will print the output 1 0 4. |
C. | The program will print the output 1 1 3. |
D. | The program will print the output 1 1 4. |
Answer» C. The program will print the output 1 1 3. | |
62. |
Which of the following statement is correct about the program given below?
#include
|
A. | The program will display 1. |
B. | The program will display 2. |
C. | The program will display 15. |
D. | The program will go into an infinite loop. |
Answer» E. | |
63. |
What will be the output of the following program?
#include
|
A. | 20 10 |
B. | 30 20 |
C. | 20 30 |
D. | 30 40 |
Answer» D. 30 40 | |
64. |
What will be the output of the following program?
#include
|
A. | a = 20 b = 40 |
B. | a = 20 b = 30 |
C. | a = 20 b = Garbage |
D. | a = Garbage b = 40 |
Answer» C. a = 20 b = Garbage | |
65. |
What will be the output of the following program?
#include
|
A. | 10 |
B. | 20 |
C. | 30 |
D. | 40 |
Answer» D. 40 | |
66. |
What will be the output of the following program?
#include
|
A. | 237 |
B. | 242 |
C. | 240 |
D. | 35 |
Answer» B. 242 | |
67. |
Which of the following statement will be correct if the function has three arguments passed to it? |
A. | The trailing argument will be the default argument. |
B. | The first argument will be the default argument. |
C. | The middle argument will be the default argument. |
D. | All the argument will be the default argument. |
Answer» B. The first argument will be the default argument. | |
68. |
Which of the following function / types of function cannot have default parameters? |
A. | Member function of class |
B. | main() |
C. | Member function of structure |
D. | Both B and C |
Answer» C. Member function of structure | |
69. |
Where the default value of parameter have to be specified? |
A. | Function call |
B. | Function definition |
C. | Function prototype |
D. | Both B or C |
Answer» D. Both B or C | |
70. |
Which of the following function prototype is perfectly acceptable? |
A. | int Function(int Tmp = Show()); |
B. | float Function(int Tmp = Show(int, float)); |
C. | Both A and B. |
D. | float = Show(int, float) Function(Tmp); |
Answer» B. float Function(int Tmp = Show(int, float)); | |