C++ basic concepts - C++ (MCQ) questions and answers

Here, you can read C++ basic concepts multiple choice questions and answers with explanation.

1)   Constant variables can be created in CPP by using ________ .
- Published on 19 Oct 15

a. enum
b. const
c. #define
d. All of these
e. None of these
Answer  Explanation 

ANSWER: All of these

Explanation:
No explanation is available for this question!


2)   Object oriented programming employs_________ programming approach.
- Published on 19 Oct 15

a. top-down
b. procedural
c. bottom-up
d. all of these.
Answer  Explanation 

ANSWER: bottom-up

Explanation:
No explanation is available for this question!


3)   In CPP, cin and cout are the predefined stream __________ .
- Published on 19 Oct 15

a. Operator
b. Functions
c. Objects
d. Data types
Answer  Explanation 

ANSWER: Objects

Explanation:
No explanation is available for this question!


4)   _________________are used for generic programming.
- Published on 19 Oct 15

a. Inheritance
b. Virtual Functions
c. Templates
d. None of these
Answer  Explanation 

ANSWER: Templates

Explanation:
No explanation is available for this question!


5)   Can a class be declared/defined inside another class ?
- Published on 19 Oct 15

a. Yes
b. No
Answer  Explanation 

ANSWER: Yes

Explanation:
No explanation is available for this question!


6)   The CPP compiler supports automatic type conversions for the user defined datatypes.
- Published on 19 Oct 15

a. True
b. False
Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


7)   Which one is suitable syntax for function template?
- Published on 19 Oct 15

a. template< class T> return_type Function_Name(parameters)
b. template< typename T> return_type Function_Name(parameters)
c. both a and b
d. None of these
Answer  Explanation 

ANSWER: both a and b

Explanation:
No explanation is available for this question!


8)   A class can contain objects of other classes and this phenomenon is called_________ .
- Published on 19 Oct 15

a. Relationship
b. Object Association
c. Containership
d. None of these
Answer  Explanation 

ANSWER: Containership

Explanation:
No explanation is available for this question!


9)   While redefining a virtual function in the derived class, if its prototype is changed then ___________________ .
- Published on 19 Jul 15

a. It will be overloaded by the compiler
b. Its virtual nature will be lost
c. both a and b
d. Compiler will generate “Prototype mismatch error”
Answer  Explanation 

ANSWER: both a and b

Explanation:
No explanation is available for this question!


10)   Object based language differs from object oriented language as it does not support features _____ .

1. Encapsulation
2. Inheritance
3. Dynamic Binding
4. Abstraction
5. Polymorphism

- Published on 19 Jul 15

a. only 3 ,4
b. only 1,3,5
c. 2,4,5
d. Only 2,3
Answer  Explanation 

ANSWER: Only 2,3

Explanation:
No explanation is available for this question!


1 2 3 4