

MCQOPTIONS
Saved Bookmarks
This section includes 134 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science knowledge and support exam preparation. Choose a topic below to get started.
101. |
Default values for a function are specified when ____ . |
A. | function is defined |
B. | function is declared |
C. | Both a and b |
D. | None of these |
Answer» C. Both a and b | |
102. |
Default values for a function are need to be specified from left to right only. |
A. | True |
B. | False |
Answer» C. | |
103. |
Default return type of functions in CPP is ____ . |
A. | void |
B. | long |
C. | char |
D. | Int |
Answer» E. | |
104. |
Constant variables can be created in CPP by using ________ . |
A. | enum |
B. | const |
C. | #define |
D. | All of these |
E. | None of these |
Answer» E. None of these | |
105. |
const member function does not allow to modify/alter value of any data member of the class. |
A. | True |
B. | False |
Answer» B. False | |
106. |
Classes in CPP are________ . |
A. | derived data types |
B. | User defined data types |
C. | built-in data types |
D. | All of these |
Answer» C. built-in data types | |
107. |
class X, class Y and class Z are derived from class BASE. This is ______ inheritance. |
A. | Multiple |
B. | Multilevel |
C. | Hierarchical |
D. | Single |
Answer» D. Single | |
108. |
Catch handler can have multiple parameters. |
A. | True |
B. | False |
Answer» C. | |
109. |
Can we write throw clause inside catch handler? |
A. | Yes |
B. | No |
Answer» B. No | |
110. |
Can we pass parameters to base class constructor though derived class or derived class constructor? |
A. | Yes |
B. | No |
Answer» B. No | |
111. |
Can we have overloading of the function templates? |
A. | Yes |
B. | No |
Answer» B. No | |
112. |
Can we define our exceptions in CPP? |
A. | Yes |
B. | No |
Answer» B. No | |
113. |
Can we alter/modify the values of data members of a class inside const member function? |
A. | Yes |
B. | No |
Answer» B. No | |
114. |
Can we allocate memory for the objects dynamically in CPP? |
A. | Yes |
B. | No |
Answer» B. No | |
115. |
Can struct be used as Base class for inheritance ? |
A. | Yes |
B. | No |
Answer» B. No | |
116. |
Can member functions of one class be friend functions of another class? |
A. | Yes |
B. | No |
Answer» B. No | |
117. |
Can a class be declared/defined inside another class ? |
A. | Yes |
B. | No |
Answer» B. No | |
118. |
C structure differs from CPP class in regards that by default all the members of the structure are __________ in nature. |
A. | private |
B. | protected |
C. | public |
D. | None of these |
Answer» D. None of these | |
119. |
By default, if a function with minimum lines of code is declared and defined inside the class becomes Inline function. |
A. | True |
B. | False |
Answer» B. False | |
120. |
By default, members of the class are ____________ in nature. |
A. | protected |
B. | private |
C. | public |
D. | static |
Answer» C. public | |
121. |
By default, all the files are opened in ___________mode . |
A. | Binary |
B. | Text |
C. | Can’t say |
Answer» C. Can’t say | |
122. |
Assume class TEST. Which of the following statements is/are responsible to invoke copy constructor? |
A. | TEST T2(T1) |
B. | TEST T4 = T1 |
C. | T2 = T1 |
D. | both a and b |
E. | All of these |
Answer» E. All of these | |
123. |
Assigning one or more function body to the same name is called ____________ . |
A. | Function Overriding |
B. | Function Overloading |
C. | Both a and b |
D. | None of the above |
Answer» C. Both a and b | |
124. |
________ are used to format the data display in CPP. |
A. | Iterators |
B. | Punctuators |
C. | Manipulators |
D. | Allocators |
Answer» D. Allocators | |
125. |
_________________are used for generic programming. |
A. | Inheritance |
B. | Virtual Functions |
C. | Templates |
D. | None of these |
Answer» D. None of these | |
126. |
An operator function is created using _____________ keyword. |
A. | iterator |
B. | allocator |
C. | constructor |
D. | operator |
Answer» E. | |
127. |
An exception is thrown using _____________ keyword in CPP. |
A. | throws |
B. | throw |
C. | threw |
D. | Thrown |
Answer» C. threw | |
128. |
An exception can be of only built-In type. |
A. | True |
B. | False |
Answer» C. | |
129. |
A virtual function that has no definition within the base class is called____________. |
A. | Pure virtual function |
B. | Pure static function |
C. | Pure Const function |
D. | Friend function |
Answer» B. Pure static function | |
130. |
A try block can be nested under another try block. |
A. | True |
B. | False |
Answer» B. False | |
131. |
A function can be declared as friend maximum only in two classes. |
A. | True |
B. | False |
Answer» C. | |
132. |
A friend function does not have 'this' pointer associated with it. |
A. | True |
B. | False |
Answer» B. False | |
133. |
A Constructor that does not have any parameters is called____________ Constructor. |
A. | Custom |
B. | Dynamic |
C. | Static |
D. | Default |
Answer» E. | |
134. |
A const object of a class can call non-const member function of the class. |
A. | True |
B. | False |
Answer» C. | |