

MCQOPTIONS
Saved Bookmarks
This section includes 77 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. | Function argument too large. |
B. | Compilation Error |
C. | Programs Executed... |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
2. |
What is the output of this program?
|
A. | Catch a integer and that integer is : 5 |
B. | Compilation Error |
C. | Testing multiple catches : |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
3. |
What is the output of this program?
|
A. | Memory allocated... |
B. | Compilation Error |
C. | Exception occurred... |
D. | Runtime Error |
E. | None of these |
Answer» B. Compilation Error | |
4. |
What is the output of this program?
|
A. | Compilation Error |
B. | 25 |
C. | Runtime Error |
D. | Division by zero condition! |
E. | None of these |
Answer» B. 25 | |
5. |
What is the output of this program?
|
A. | Exception value is: 10 |
B. | Compilation Error |
C. | Exception value is: 3.5 |
D. | Exception Caught: Wrong number used |
E. | None of these |
Answer» E. None of these | |
6. |
What is the output of this program?
|
A. | Invalid argument |
B. | 50 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
7. |
What is the output of this program?
|
A. | Bad Operator caught |
B. | Division by zero not allowed |
C. | 10 |
D. | 20 |
E. | 4 |
Answer» F. | |
8. |
What is the output of this program?
|
A. | Compilation Error |
B. | Exception caught by bad_cast |
C. | Runtime Error |
D. | Garbage Value |
E. | None of these |
Answer» C. Runtime Error | |
9. |
What is the output of this program?
|
A. | 5 |
B. | 0 |
C. | depends on compiler |
D. | bad_alloc |
E. | None of these |
Answer» C. depends on compiler | |
10. |
What is the output of this program?
|
A. | Memory Allocated |
B. | Compilation Error |
C. | Standard exception: |
D. | Runtime Error |
E. | None of these |
Answer» B. Compilation Error | |
11. |
What is the output of this program?
|
A. | Exception |
B. | Compilation Error |
C. | New exception occurred... |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
12. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage value |
D. | New Exception... |
E. | None of these |
Answer» E. None of these | |
13. |
What is the output of this program?
|
A. | 15 |
B. | Exception occurred... |
C. | Compilation Error |
D. | Exception occurred...15 |
E. | None of these |
Answer» E. None of these | |
14. |
What is the output of this program?
|
A. | 40 |
B. | Division by zero condition! |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» C. Compilation Error | |
15. |
What is the output of this program?
|
A. | 20 |
B. | 30 |
C. | 60 |
D. | -6 |
E. | None of these |
Answer» E. None of these | |
16. |
What is the output of this program?
|
A. | 0.0 |
B. | 16 |
C. | 4 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
17. |
What is the output of this program?
|
A. | 8 |
B. | 4 |
C. | 2 |
D. | 1 |
E. | Depends on compiler |
Answer» F. | |
18. |
What is the output of this program?
|
A. | Can t able to create the dynamic instance for the triangle, So it is arising an exception |
B. | Compilation Error |
C. | Runtime Error |
D. | Can't do the Dynamic_cast |
E. | None of these |
Answer» B. Compilation Error | |
19. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | out_of_range |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
20. |
What is the output of this program?
|
A. | Compilation Error |
B. | Null |
C. | Exception Occurred: std::bad_alloc |
D. | Exception Occurred: std::bad_typeid |
E. | None of these |
Answer» E. None of these | |
21. |
What is the output of this program?
|
A. | Caught an int |
B. | In empty() |
C. | Will throw an int |
D. | All of above |
E. | None of these |
Answer» E. None of these | |
22. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | terminate handler called... |
D. | Aborted |
E. | None of these |
Answer» E. None of these | |
23. |
What is the output of this program?
|
A. | Aborted |
B. | terminate |
C. | First |
D. | inside catch(...) block |
E. | None of these |
Answer» B. terminate | |
24. |
What is the output of this program?
|
A. | Runtime Error |
B. | Compilation Error |
C. | Illegal initialization |
D. | Garbage value |
E. | None of these |
Answer» C. Illegal initialization | |
25. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Integer exception raised... |
D. | Function() was called by terminate(). |
E. | None of these |
Answer» E. None of these | |
26. |
What is the output of this program?
|
A. | Caught an exception |
B. | Compilation Error |
C. | Runtime Error |
D. | Garbage value |
E. | None of these |
Answer» B. Compilation Error | |
27. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | p is NULL |
D. | Exception occurred: exiting |
E. | None of these |
Answer» E. None of these | |
28. |
What is the output of this program?
|
A. | An Exception caught: std::bad_alloc |
B. | An Exception caught: std::bad_cast |
C. | An Exception caught: std::bad_typeid |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
29. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | -2 |
D. | Exception occurred: Thrown value is -2 |
E. | None of these |
Answer» E. None of these | |
30. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage Value |
D. | Is not a valid Option... |
E. | None of these |
Answer» E. None of these | |
31. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Division by zero condition Occurred... |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
32. |
What is the output of this program?
|
A. | Positive Number Required |
B. | 8 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» C. Compilation Error | |
33. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Exception Occurred... |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
34. |
What is the output of this program?
|
A. | Exception number: 13 |
B. | 13 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» B. 13 | |
35. |
What is the output of this program?
|
A. | 9 |
B. | 3 |
C. | 9 / 3 = 3 |
D. | Bad Operator |
E. | None of these |
Answer» D. Bad Operator | |
36. |
What is the output of this program?
|
A. | Memory Allocated... |
B. | Compilation Error |
C. | Runtime Error |
D. | Garbage Value |
E. | None of these |
Answer» B. Compilation Error | |
37. |
What is the output of this program?
|
A. | Depends on the memory of the computer |
B. | Allocated successfully |
C. | Error allocating the requested memory |
D. | All of above |
E. | None of these |
Answer» B. Allocated successfully | |
38. |
What is the output of this program?
|
A. | abnormal program termination |
B. | caught a double type |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» B. caught a double type | |
39. |
What is the output of this program?
|
A. | Depends on the size of the data type |
B. | 4 Bytes allocated successfully |
C. | 8 Byte successfully allocated! |
D. | Memory allocation failure |
E. | None of these |
Answer» B. 4 Bytes allocated successfully | |
40. |
What is the output of this program?
|
A. | 4 |
B. | 20 |
C. | 100 |
D. | Compilation Error |
E. | None of these |
Answer» B. 20 | |
41. |
What is the output of this program?
|
A. | Runtime Error |
B. | Compilation Error |
C. | prints first 4 numbers |
D. | prints first 4 numbers and throws exception at 5 |
E. | None of these |
Answer» E. None of these | |
42. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage value |
D. | error:Positive Number Required |
E. | None of these |
Answer» E. None of these | |
43. |
When exceptions are used? |
A. | Exceptions are used when postconditions of a function cannot be satisfied |
B. | Exceptions are used when postconditions of a function can be satisfied |
C. | To preserve the program |
D. | All of above |
E. | None of these |
Answer» C. To preserve the program | |
44. |
Pick out the correct Answer. |
A. | Exception are suitable for critical points in code |
B. | Exceptions are not suitable for critical points in code |
C. | Exception are suitable for One points in code |
D. | All of above |
E. | None of these |
Answer» C. Exception are suitable for One points in code | |
45. |
How many parameters does the throw expression can have? |
A. | 4 |
B. | 3 |
C. | 2 |
D. | 1 |
E. | None of these |
Answer» E. None of these | |
46. |
Which is used to handle the exceptions in c++? |
A. | exception handler |
B. | catch handler |
C. | handler |
D. | All of above |
E. | None of these |
Answer» B. catch handler | |
47. |
What should present when throwing a object? |
A. | destructor |
B. | constructor |
C. | copy-constructor |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
48. |
How to handle the exception in constructor? |
A. | Function |
B. | We have to throw an exception |
C. | We have to return the exception |
D. | We have to throw an exception & return the exception |
E. | None of these |
Answer» C. We have to return the exception | |
49. |
What will happen when an exception is uncaught? |
A. | execute continuously |
B. | arise an error |
C. | program will run |
D. | All of above |
E. | None of these |
Answer» C. program will run | |
50. |
Which operations don t throw anything? |
A. | Operations which are irreversible |
B. | Operations which are dynamic |
C. | Operations which are reversible |
D. | Operations which are static |
E. | None of these |
Answer» B. Operations which are dynamic | |