

MCQOPTIONS
Saved Bookmarks
This section includes 26 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. | InterviewMania |
B. | 5 |
C. | 7 |
D. | 8 |
E. | Compilation Error |
Answer» D. 8 | |
2. |
What is the output of this program?
|
A. | 51 66 |
B. | 66 51 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» C. Compilation Error | |
3. |
What is the output of this program?
|
A. | 36 |
B. | 15 |
C. | 16 |
D. | 20 |
E. | None of these |
Answer» E. None of these | |
4. |
What is the output of this program?
|
A. | 11 |
B. | 123 |
C. | 321 |
D. | 132 |
E. | None of these |
Answer» E. None of these | |
5. |
What is the new value of P?
|
A. | New value of P is 12 |
B. | Compilation Error |
C. | New value of P is 15 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
6. |
What is the output of this program?
|
A. | 15 |
B. | 12 |
C. | Runtime Error |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
7. |
What is the output of this program?
|
A. | M = 6, N = 6, O = 6 |
B. | N = 6, O = 6, M = 6 |
C. | O = 6, M = 6 |
D. | Compilation Error |
E. | None of these |
Answer» B. N = 6, O = 6, M = 6 | |
8. |
What is the output of this program?
|
A. | 1 |
B. | 5 |
C. | 10 |
D. | 20 |
E. | Compilation Error |
Answer» D. 20 | |
9. |
What is the output of this program?
|
A. | 2 |
B. | 3 |
C. | 4 |
D. | 5 |
E. | Compilation Error |
Answer» B. 3 | |
10. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage value |
D. | The message you entered |
E. | None of these |
Answer» E. None of these | |
11. |
What is the output of this program?
|
A. | Condition is true. P = 250 |
B. | 200 |
C. | Condition is false. P = 250 |
D. | True |
E. | False |
Answer» D. True | |
12. |
What is the output of this program?
|
A. | 2 5 10 3 6 9 7 |
B. | 2 3 5 6 7 9 10 |
C. | 10 9 7 6 5 3 2 |
D. | 5 6 7 9 3 2 10 |
E. | 5 10 6 9 7 |
Answer» F. | |
13. |
What will happen when we use void in argument passing? |
A. | Maybe or may not be return any value to its caller |
B. | It will not return value to its caller |
C. | It will return value to its caller |
D. | All of above |
E. | None of these |
Answer» C. It will return value to its caller | |
14. |
What is the new value of P? |
A. | New value of P is 12 |
B. | Compilation Error |
C. | New value of P is 15 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
15. |
What is the default return type of a function? |
A. | char |
B. | float |
C. | void |
D. | int |
E. | None of these |
Answer» D. int | |
16. |
If we start our function call with default arguments means, what will be proceeding arguments? |
A. | default arguments |
B. | user argument |
C. | empty arguments |
D. | All of above |
E. | None of these |
Answer» B. user argument | |
17. |
What is the maximum number of arguments or parameters that can be present in one function call? |
A. | 16 |
B. | 255 |
C. | 64 |
D. | 256 |
E. | None of these |
Answer» E. None of these | |
18. |
How can you access the arguments that are manipulated in the function? |
A. | arg_list |
B. | va_list |
C. | both arg_list & va_list |
D. | All of above |
E. | None of these |
Answer» C. both arg_list & va_list | |
19. |
Which value will it take when both user and default values are given? |
A. | custom value |
B. | default value |
C. | user value |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
20. |
What we can t place followed by the non-default arguments? |
A. | default arguments |
B. | trailing arguments |
C. | both default & trailing arguments |
D. | All of above |
E. | None of these |
Answer» B. trailing arguments | |
21. |
Which header file is used to pass unknown number of arguments to function? |
A. | stdarg.h |
B. | stdlib.h |
C. | string.h |
D. | All of above |
E. | None of these |
Answer» B. stdlib.h | |
22. |
Where can the default parameter be placed by the user? |
A. | rightmost |
B. | leftmost |
C. | both rightmost & leftmost |
D. | All of above |
E. | None of these |
Answer» B. leftmost | |
23. |
If the user did not supply the value, what value will it take? |
A. | rise an error |
B. | default value |
C. | both rise an error & default value |
D. | All of above |
E. | None of these |
Answer» C. both rise an error & default value | |
24. |
How many ways of passing a parameter are there in c++? |
A. | 4 |
B. | 3 |
C. | 2 |
D. | 1 |
E. | None of these |
Answer» C. 2 | |
25. |
What will initialize the list of arguments in stdarg.h header file? |
A. | va_start |
B. | va_arg |
C. | va_list |
D. | All of above |
E. | None of these |
Answer» B. va_arg | |
26. |
Which header file should you include if you are to develop a function that can accept variable number of arguments? |
A. | stdio.h |
B. | varag.h |
C. | stdarg.h |
D. | stdlib.h |
E. | None of these |
Answer» D. stdlib.h | |