C++ Programming Questions Answers - Set 2 Online Quiz Test
-
1. Size of a char is ?
- 1
- 2
- 3
- 4
-
2. Which of following valid option will not return a value in c++ ?
- free
- void
- empty
- null
-
3. Constructors has return type void ?
- True
- False
-
4. Enumerators are stored by the compiler in ?
- string
- integer
- float
- any of above
-
5. Enumerator will allocate the memory when its variables are defined.
- True
- False
-
6. Data members and member functions are enclosed within ?
- union
- structure
- class
- array
-
7. & operator is ?
- address operator
- indirection operator
- logical and
- logical or
-
8. The default visibility mode while inheriting is ?
- public
- protected
- private
- may be any of above
-
9. The process of deriving a class from another derived class is known as ?
- single inheritance
- dual inheritance
- multiple inheritance
- multilevel inheritance
-
10. When a derived class inherits from many base classes, this process is known as ?
- multiple inheritance
- multilevel inheritance
- default inheritance
- multiplex inheritance
-
11. Inheritance is transitive in nature.
- True
- False
-
12. Which variables cannot be declared ?
- structure
- pointer
- class
- void
-
13. The derived class constructor
- never passes any values to base class constructor
- can pass arguments only to one base class constructor function
- is responsible for passing the entire test of arguments needed by base class constructors
- none of above
-
14. Inheritance is referred to as
- “is a” relationship
- "have a" relationship
- both of above
- none of above
-
15. Stacks are based on ?
- FIFO
- LIFO
- FILO
- All of above
-
16. An explicitly defined destructor function
- may be virtual
- may not be virtual
- will always be virtual
- will never be virtual
-
17. Queues are based on ?
- LIFO
- FIFO
- LILO
- FILO
-
18. int *ptr[5];
- a pointer of 5 int elements
- an array of 5 int pointers
- an array of 5 elements returning an int value
- none of above
-
19. When a structure refers to itself, it is known as ?
- encapsulated structure
- nested structure
- recursive structure
- self-referential structure
-
20. Destructors are called ?
- not defined
- in any order
- in the reverse order of constructor calls
- in the same order of constructor calls