1. When a function is defined inside a class, this function is called ………….
A) Inside function
B) Class function
C) Inline function
D) Interior function
A) Reference variable
C) Class objects
D) Header files
3. State true of false.
i) We cannot make the function inline by defining a function outside the class.
ii) A member function can be called by using its name inside another member function of the same class, this is known as nesting of member function.
A) True, True
B) True, False
C) False, True
D) False, False
4. Which of the following operators could be overloaded?
A) Size of
i) It is initialized to zero when the first object of its class is created. Other initialization is also permitted.
ii) It is visible only within the class, but its lifetime is the entire program.
A) i-True, ii-True
B) ii-False, ii-True
C) i-True, ii-False
D) i-False, iii-False
6. Which of the following keywords are used to control access to a class member?
7. What will be the values of x, m and n after execution of the following statements?
Int x, m, n;
x= ++m + n++;
A) x=25, m=10, n=15
B) x=27, m=10, n=15
C) x=26, m=11, n=16
D) x=27, m=11, n=16
9. A variable is defined within a block in a body of a function. Which of the following are true?
8. The major goal of inheritance in C++ is
A) To facilitate the conversion of data types
B) To help modular programming
C) To facilitate the re usability of code
D) To extend the capabilities of a class
A) It is visible throughout the function.
B) It is visible from the point of definition to the end of the program.
C) It is visible from the point of definition to the end of the block.
D) It is visible throughout the block.
10. The friend functions are used in situations where
A) We want to exchange data between classes
B) We want to have access to unrelated classes
C) Dynamic binding is required
D) We want to create versatile overloaded operators.
11. ………….. means that the code associated with a given procedure call is not known until the time of the call at run time.
A) dynamic binding
B) run time binding
C) early binding
12. Through ………………., we can eliminate redundant code and extend the use of existing classes.
i) Software complexity can be easily managed.
ii) It is easy to partition the work in a project based on objects.
A) True, False
B) False, True
C) True, True
D) False, False
14. Major features that are required for object based programming is/are
i) Data encapsulation ii) Data hiding iii) Automatic initialization iv) operator overloading
A) i, ii and iii only
B) ii, iii and iv only
C) i, iii and iv only
D) All i, ii, iii and iv
15. In OOP, a problem is considered as a collection of number of entities called ………………
1. C) Inline function
2. D) Header files
3. C) False, True
4. B) +
5. B) ii-False, ii-True
6. C) protected
7. C) x=26, m=11, n=16
8. C) To facilitate the reusability of code
9. D) It is visible throughout the block.
10. A) We want to exchange … classes
11. A) dynamic binding
12. C) Inheritance
13. C) True, True
14. D) All i, ii, iii and iv
15. B) objects
Read More:C and C++ MCQ Questions