download Mastguru Android App

C++ Programming Questions Answers - Set 2 Online Quiz Test

  • 1. The members of a class are ?

    b) by default are private
    c) are made private by declaring as private
    d) none of the above]

    1. have no visibility by default
    2. public by default
    3. private by default
    4. protected by default
  • 2. The function used to define the task assigned to an operator is ?

    1. Virtual function
    2. Static function
    3. Operator function
    4. Friend function
  • 3. Which operators can not be overloaded ?

    1. Binary operator
    2. Ternary operator
    3. Unary operator
    4. All can be overloaded
  • 4. Classes in c++ are ?

    1. Fundamental data type
    2. Primitive data type
    3. Desired data type
    4. Not defined
  • 5. 37. Which of the following statements is false ?

    1. Using typedef does not replace the standard C++ data type name with the new name
    2. The new name defined by typedef, can be used as a type for another typedef
    3. typedef defines new data types
    4. None of the above
  • 6. 66. A constructor function is generally defined

    1. In the private section of a class
    2. In the public section of a class
    3. In the protected section of a class
    4. None of the above
  • 7. The symbol ** __ .

    1. can be overloaded by changing its datatype.
    2. cannot be overloaded, as on overloading its meaning shall be changed.
    3. can be overloaded.
    4. cannot be overloaded as it is not a C++ operator.
  • 8. Only one copy of the class is inherited, when it is defined as ?

    1. virtual
    2. public
    3. static
    4. private
  • 9. && means ?

    1. Logical OR
    2. Bitwise OR
    3. Logical AND
    4. Bitwise AND
  • 10. Explicit call to a constructor means ?

    1. Not providing the construction name at all
    2. Is the shorthand method
    3. Providing the constructor name explicitly to invoke it
    4. Providing the constructor name implicitly to invoke it
  • 11. 78. If new operator is used, then the constructor function is ?

    1. Copy constructor
    2. Default constructor
    3. Static constructor
    4. Dynamic constructor
  • 12. The antonym of constructor is ?

    1. Creator
    2. Distinct
    3. Destroyer
    4. Destructor
  • 13. A Variable __ of void type.

    1. May be declared
    2. Can be initialized
    3. Cannot be intialized
    4. Cannot be declared
  • 14. When one class inherits from the base class, then the original class is called ?

    1. derived class
    2. base class
    3. sub class
    4. basic class
  • 15. Operator overloading is ?

    1. giving new meaning to existing c++ operators
    2. making c++ operators work with objects
    3. giving c++ operators more than they can handle
    4. making new c++ operators
  • 16. A virtual base class ?

    1. is qualified as virtual in base class definition.
    2. do not qualified as virtual in base class definition.
    3. allows to inherit more than one copy of the base class members.
    4. strict the path of inheritance.
  • 17. A class having no public constructors is

    1. A public protected class
    2. A public class
    3. A protected class
    4. A private class
  • 18. What is default scope for a structure ?

    1. Private
    2. Protected
    3. Public
    4. None of aobve
  • 19. The objects can directly access ?

    1. Public members
    2. Private members
    3. Both of above
    4. None of above
  • 20. The advantage of declaring a virtual function as pure is
    ?

    1. programs runs faster
    2. early binding can be achieved
    3. you force any derived class to define its own implementation
    4. you can avoid making the class an abstract class
Submit Quiz
Post a comment