C++ Multiple Choice Questions

  1. Local Variables can be access ?
    1. Code block enclosed in braces { }.
    2. Code block enclosed in bracket ().
    3. Code block enclosed in square bracket [].
    4. None of the above
Answer :
A
Explanation:
Added By : Rajesh


  1. Global Variables can be access ?
    1. Anywhere in the code except inside functions. After it's declaration.
    2. Anywhere in the code, even inside functions. After it's declaration.
    3. Nowhere in the code
    4. None of the above
Answer :
B
Explanation:
Added By : Rajesh

  1. In C++ every statement end with?
    1. Colon (:)
    2. Comma (,)
    3. Dot (.)
    4. None of the above
Answer :
D
Explanation:
Every C++ statement end with semicolon ( ; ).
Added By : Rajesh


  1. What is pointer?
    1. The variable that stores the reference to another variable
    2. The variable that stores reference of garbage variable
    3. The variable that stores the memory address of another variable
    4. A & C Both
Answer :
D
Explanation:
Added By : Abhijit Kumar

  1. If class A inherits from more than one class, ie. A inherits from B1, B2,... is called
    1. Single Inheritance
    2. Multilevel Inheritance
    3. Multiple Inheritance
    4. None of the above
Answer :
C
Explanation:
Added By : Sumit

  1. If class A inherits from class B, then B is called _______ of A. A is called ________ of B.
    1. Super class, Sub class
    2. Subclass, Super class
    3. Abstract class, Base Class
    4. Child class, Sub Class
Answer :
A
Explanation:
Added By : Sumit


  1. ________ is the mechanism which allows a class A to inherit properties of a class B.
    1. Data abstraction
    2. Encapsulation
    3. Inheritance
    4. Polymorphism
Answer :
C
Explanation:
Added By : Sumit

  1. Which of the following statements is correct?
    1. First time method of a class is called, the constructor method is called.
    2. Every time method of a class is called, the constructor method is called.
    3. Every time an instance of a class is created, the constructor method is called.
    4. None of the above
Answer :
C
Explanation:
Added By : Jagdish Gupta

Post Your Question
Social Sharing
Search