

MCQOPTIONS
Saved Bookmarks
This section includes 51 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. | 10 |
B. | 14 |
C. | 14 10 |
D. | 10 14 |
E. | None of these |
Answer» E. None of these | |
2. |
What is the output of this program?
|
A. | 3 6 |
B. | 6 3 |
C. | 9 18 |
D. | 18 9 |
E. | None of these |
Answer» E. None of these | |
3. |
What is the output of this program?
|
A. | 36 |
B. | 12 |
C. | 3 |
D. | All of above |
E. | None of these |
Answer» B. 12 | |
4. |
What is the output of this program?
|
A. | 4 5 6 |
B. | 6 5 4 |
C. | 5 6 4 |
D. | 6 4 5 |
E. | None of these |
Answer» B. 6 5 4 | |
5. |
What is the output of this program?
|
A. | 15 |
B. | 25 |
C. | 25 15 |
D. | 15 25 |
E. | None of these |
Answer» E. None of these | |
6. |
What is the output of this program?
|
A. | Compilation Error |
B. | The program exceuted |
C. | Runtime Error |
D. | Garbage value |
E. | None of these |
Answer» C. Runtime Error | |
7. |
What is the output of this program?
|
A. | 12.25 |
B. | Compilation Error |
C. | 120.0625 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
8. |
What is the output of this program?
|
A. | 5 2 |
B. | 2 5 |
C. | 10 5 |
D. | 5 10 |
E. | None of these |
Answer» D. 5 10 | |
9. |
What is the output of this program?
|
A. | 50.25 |
B. | 42.52 |
C. | 99.77 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
10. |
What is the output of this program?
|
A. | 5 3 |
B. | 3 5 3 |
C. | 3 3 5 |
D. | 5 3 3 |
E. | None of these |
Answer» C. 3 3 5 | |
11. |
What is the output of this program?
|
A. | Interview Mania |
B. | Interview Mania is awesome. |
C. | is awesome. |
D. | Compilation Error |
E. | None of these |
Answer» C. is awesome. | |
12. |
What is the output of this program?
|
A. | 12 |
B. | 105 |
C. | 105 12 |
D. | 12 105 |
E. | None of these |
Answer» E. None of these | |
13. |
What is the output of this program?
|
A. | Interview |
B. | Mania |
C. | Inter * view Mania |
D. | Interview Mania |
E. | None of these |
Answer» D. Interview Mania | |
14. |
What is the output of this program?
|
A. | Caught Base Class Exception |
B. | Compilation Error |
C. | Caught Derived Class Exception |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
15. |
What is the output of this program?
|
A. | Runtime Error |
B. | Garbage value |
C. | Compilation Error |
D. | Entered Variable is: 15 |
E. | None of these |
Answer» D. Entered Variable is: 15 | |
16. |
What is the output of the following program?
|
A. | 3 |
B. | 4 |
C. | 2.15 |
D. | 25.8 |
E. | None of these |
Answer» E. None of these | |
17. |
What is the output of this program?
|
A. | N::N(N const & ) |
B. | N |
C. | N::operator=(N const &) |
D. | N::N() |
E. | None of these |
Answer» E. None of these | |
18. |
What is the output of this program?
|
A. | 5 |
B. | 6 |
C. | 5 6 |
D. | 6 5 |
E. | None of these |
Answer» E. None of these | |
19. |
What is the output of this program?
|
A. | 6 I 5.35 |
B. | 6 3.5 |
C. | I 5.3 6 |
D. | I 6 |
E. | 6 5.35 I |
Answer» F. | |
20. |
What is the output of this program?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage Value |
D. | 15 |
E. | None of these |
Answer» E. None of these | |
21. |
What is the output of this program?
|
A. | Program not execute... |
B. | Program executed... |
C. | Compilation Error |
D. | Runtime Error |
E. | Garbage Value |
Answer» C. Compilation Error | |
22. |
What is the output of this program?
|
A. | Area of Rectangle : 30 |
B. | Area of Rectangle : 3 |
C. | Area of Rectangle : 4 |
D. | Compilation Error |
E. | None of these |
Answer» B. Area of Rectangle : 3 | |
23. |
What does the cerr represent? |
A. | Output stream |
B. | Input stream |
C. | Standard logging stream |
D. | Standard error stream |
E. | None of these |
Answer» E. None of these | |
24. |
How many types of guarantees are there in exception class can have? |
A. | 4 |
B. | 3 |
C. | 2 |
D. | 1 |
E. | None of these |
Answer» C. 2 | |
25. |
Which operator is used to create the user-defined streams in c++? |
A. | << |
B. | >> |
C. | Both >> and << |
D. | & |
E. | None of these |
Answer» D. & | |
26. |
How to store the large objects in c++ if it extends its allocated memory? |
A. | queue |
B. | memory heap |
C. | stack |
D. | All of above |
E. | None of these |
Answer» C. stack | |
27. |
Which special character is used to mark the end of class? |
A. | $ |
B. | # |
C. | : |
D. | ; |
E. | None of these |
Answer» E. None of these | |
28. |
When struct is used instead of the keyword class means, what will happen in the program? |
A. | access is protected by default |
B. | access is public by default |
C. | access is private by default |
D. | All of above |
E. | None of these |
Answer» C. access is private by default | |
29. |
Which is used to create a pure virtual function ? |
A. | ! |
B. | & |
C. | $ |
D. | =0 |
E. | None of these |
Answer» E. None of these | |
30. |
Which class is used to design the base class? |
A. | base class |
B. | derived class |
C. | abstract class |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
31. |
Where does the abstract class is used? |
A. | funciton |
B. | derived class |
C. | base class only |
D. | both derived & base class |
E. | None of these |
Answer» D. both derived & base class | |
32. |
How many types of class are there in c++? |
A. | 4 |
B. | 3 |
C. | 2 |
D. | 1 |
E. | None of these |
Answer» C. 2 | |
33. |
How many ways of reusing are there in the class hierarchy? |
A. | 4 |
B. | 3 |
C. | 2 |
D. | 1 |
E. | None of these |
Answer» D. 1 | |
34. |
Which interface determines how your class will be used by another program? |
A. | private |
B. | protected |
C. | public |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
35. |
Pick out the correct statement about the override. |
A. | Overriding refers to a derived class |
B. | Overriding refers to a derived class function that has the same name and signature as a base class virtual function |
C. | Overriding has different names |
D. | All of above |
E. | None of these |
Answer» C. Overriding has different names | |
36. |
What is the syntax of inheritance of class? |
A. | class name: access specifier |
B. | class name: access specifier class name |
C. | class name |
D. | All of above |
E. | None of these |
Answer» C. class name | |
37. |
What does inheritance allow you to do? |
A. | access methods |
B. | create a class |
C. | create a hierarchy of classes |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
38. |
Pick out the correct statement about multiple inheritances. |
A. | Deriving a class from more than one direct base class |
B. | Deriving a class from more than one direct derived class |
C. | Deriving a class from one direct base class |
D. | All of above |
E. | None of these |
Answer» B. Deriving a class from more than one direct derived class | |
39. |
Which constructor will initialize the base class data member? |
A. | class |
B. | derived class |
C. | base class |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
40. |
What does derived class does not inherit from the base class? |
A. | friends |
B. | operator = () members |
C. | constructor and destructor |
D. | All of above |
E. | None of these |
Answer» E. None of these | |
41. |
What should be the name of the constructor? |
A. | same as the member |
B. | same as the class |
C. | same as the object |
D. | All of above |
E. | None of these |
Answer» C. same as the object | |
42. |
What is the use of clog? |
A. | Input stream |
B. | Standard logging stream |
C. | Error stream |
D. | All of above |
E. | None of these |
Answer» C. Error stream | |
43. |
Which classes are called as mixin? |
A. | Standard logging stream |
B. | Represent a secondary design |
C. | Classes express functionality which represent responsibilities |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
44. |
Which operator is used to declare the destructor? |
A. | $ |
B. | |
C. | @~ |
D. | # |
E. | None of these |
Answer» D. # | |
45. |
Where is the derived class is derived from? |
A. | base |
B. | derived |
C. | Top |
D. | both derived & base |
E. | None of these |
Answer» B. derived | |
46. |
Where does the object is created? |
A. | attributes |
B. | destructor |
C. | constructor |
D. | class |
E. | None of these |
Answer» E. None of these | |
47. |
The fields in the class in c++ program are by default |
A. | private |
B. | public |
C. | protected |
D. | All of above |
E. | None of these |
Answer» B. public | |
48. |
Which of the following is a valid class declaration? |
A. | object A { int x; }; |
B. | public class A { } |
C. | class A { int x; }; |
D. | class B { } |
E. | None of these |
Answer» D. class B { } | |
49. |
Which other keywords are also used to declare the class other than class? |
A. | union |
B. | struct |
C. | both union & struct |
D. | object |
E. | None of these |
Answer» D. object | |
50. |
Which is used to define the member of a class externally? |
A. | # |
B. | : |
C. | :: |
D. | All of above |
E. | None of these |
Answer» D. All of above | |