download Mastguru Android App

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

  • 1. Size of a char is ?

    1. 1
    2. 2
    3. 3
    4. 4
  • 2. Which of following valid option will not return a value in c++ ?

    1. free
    2. void
    3. empty
    4. null
  • 3. Constructors has return type void ?

    1. True
    2. False
  • 4. Enumerators are stored by the compiler in ?

    1. string
    2. integer
    3. float
    4. any of above
  • 5. Enumerator will allocate the memory when its variables are defined.

    1. True
    2. False
  • 6. Data members and member functions are enclosed within ?

    1. union
    2. structure
    3. class
    4. array
  • 7. & operator is ?

    1. address operator
    2. indirection operator
    3. logical and
    4. logical or
  • 8. The default visibility mode while inheriting is ?

    1. public
    2. protected
    3. private
    4. may be any of above
  • 9. The process of deriving a class from another derived class is known as ?

    1. single inheritance
    2. dual inheritance
    3. multiple inheritance
    4. multilevel inheritance
  • 10. When a derived class inherits from many base classes, this process is known as ?

    1. multiple inheritance
    2. multilevel inheritance
    3. default inheritance
    4. multiplex inheritance
  • 11. Inheritance is transitive in nature.

    1. True
    2. False
  • 12. Which variables cannot be declared ?

    1. structure
    2. pointer
    3. class
    4. void
  • 13. The derived class constructor

    1. never passes any values to base class constructor
    2. can pass arguments only to one base class constructor function
    3. is responsible for passing the entire test of arguments needed by base class constructors
    4. none of above
  • 14. Inheritance is referred to as

    1. “is a” relationship
    2. "have a" relationship
    3. both of above
    4. none of above
  • 15. Stacks are based on ?

    1. FIFO
    2. LIFO
    3. FILO
    4. All of above
  • 16. An explicitly defined destructor function

    1. may be virtual
    2. may not be virtual
    3. will always be virtual
    4. will never be virtual
  • 17. Queues are based on ?

    1. LIFO
    2. FIFO
    3. LILO
    4. FILO
  • 18. int *ptr[5];

    1. a pointer of 5 int elements
    2. an array of 5 int pointers
    3. an array of 5 elements returning an int value
    4. none of above
  • 19. When a structure refers to itself, it is known as ?

    1. encapsulated structure
    2. nested structure
    3. recursive structure
    4. self-referential structure
  • 20. Destructors are called ?

    1. not defined
    2. in any order
    3. in the reverse order of constructor calls
    4. in the same order of constructor calls
Submit Quiz
Post a comment