On This Page

This set of CPP Programming Multiple Choice Questions & Answers (MCQs) focuses on Cpp Programming Set 1

Q1 | Which of the followings is/are automatically added to every class, if we do not write ourown?
Q2 | When a copy constructor may be called?
Q3 | Constructors have _____ return type.
Q4 | Implicit return type of a class constructor is:
Q5 | Which of the following is true about constructors?1) They cannot be virtual.2) They cannot be private.3) They are automatically called by new operator.
Q6 | Output of following program?#includeusing namespace std;class Point {Point() { cout << "Constructor called"; }}; int main(){Point t1;return 0;}
Q7 | #includeusing namespace std;class Point {public:Point() { cout << "Constructor called"; }};int main(){Point t1, *t2;return 0;}
Q8 | Which operator is having the highest precedence?
Q9 | Which of the following is FALSE about references in C++?
Q10 | Which of the following functions must use reference?
Q11 | Output of following C++ program?#includeusing namespace std;int main(){int x = 10;int& ref = x;ref = 20;cout << "x = " << x << endl ;x = 30;cout << "ref = " << ref << endl;return 0;}
Q12 | What is the difference between struct and class in C++?
Q13 | Predict the output of following C++ program.#includeusing namespace std;class Empty {};int main() {cout << sizeof(Empty);return 0;}
Q14 | class Test {int x;};int main() {Test t;cout << t.x;return 0;}
Q15 | Which of the following is true?
Q16 | A member function can always access the data in __________, (in C++).
Q17 | Which of the following is not correct for virtual function in C++?
Q18 | Which of the following is not correct (in C++)?1. Class templates and function templates are instantiated in the same way2. Class templates differ from function templates in the way they are initiated3. Class template is initiated by defining an object using the template argument4. Class templates are generally used for storage classes
Q19 | Which of the following cannot be passed to a function in C++?
Q20 | Which of the following, in C++, is inherited in a derived class from base class?
Q21 | Which of the following is a correct statement?
Q22 | Which of the following is not a correct statement?
Q23 | When a method in a subclass has the same name and type signatures as a method in thesuperclass, then the method in the subclass _____ the method in the superclass.
Q24 | It is possible to define a class within a class termed as nested class. There are _____ types of nested classes.
Q25 | When one object reference variable is assigned to another object reference variable then