

MCQOPTIONS
Saved Bookmarks
This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
1. |
Unary scope resolution operator is denoted by |
A. | ! ! |
B. | % % |
C. | : |
D. | : : |
E. | |
Answer» E. | |
2. |
Inline functions may not work ______ .i) If function contain static variables.ii) If function contain global and register variables.iii) If function returning value consists looping construct(i.e. for, while).iv) If inline functions are recursive.v) If function contains const value. |
A. | Only i,iv & v |
B. | Only ii,iii & v |
C. | Only i,iii & iv |
D. | All of the above |
Answer» D. All of the above | |
3. |
Which of the following function declaration using default arguments is incorrect? |
A. | int foo(int x, int y =5, int z=10) |
B. | int foo(int x=5, int y =10, int z) |
C. | int foo(int x=5, int y, int z=10) |
D. | All are correct |
Answer» B. int foo(int x=5, int y =10, int z) | |
4. |
|
A. | Only one parameter of a function can be a default parameter. |
B. | Minimum one parameter of a function must be a default parameter. |
C. | All the parameters of a function can be default parameters. |
D. | No parameter of a function can be default. |
Answer» D. No parameter of a function can be default. | |
5. |
Predict the output: |
A. | 3.14 |
B. | 3.15 |
C. | 3 |
D. | 3.1 |
Answer» E. | |
6. |
Which of the following in Object Oriented Programming is supported by Function overloading and default arguments features of C++. |
A. | Inheritance |
B. | Polymorphism |
C. | Encapsulation |
D. | None of these |
Answer» C. Encapsulation | |
7. |
Correct way to declare pure virtual function in a C++ class is |
A. | Virtual void foo() =0 ; |
B. | Void virtual foo()= { 0 } |
C. | Virtual void foo() {} = 0; |
D. | None of the above |
Answer» B. Void virtual foo()= { 0 } | |