Programming MCQs

Solved MCQ Questions On C++ Programming Set-1

Pinterest LinkedIn Tumblr
Here are the collections of solved MCQ questions on C++ includes multiple-choice questions on the fundamentals of object-oriented programming in C++. It includes MCQ questions on the history of C++ language, C++ keywords and operators along with inline expressions and control structures. It also includes procedure-oriented programming along with object-oriented programming.

1. C++ is an extension of C with a major addition of the class construct feature of ……………..
A) Simula67
B) Simula57
C) Simula47
D) Simula87

2. C++ has the name ………………….. before it was changed to C++.
A) Improved C
B) Integrated C
C) C with classes
D) C with Simula

3. …………. Refer to the names of variables, functions, arrays, classes etc. created by the programmer.
A) Keywords
B) Identifiers
C) Constraints
D) Strings

4. In C++, the keyword void was used ………..
A) To specify the return type of function when it is not returning any value.
B) To indicate an empty argument list to a function.
C) To declare the generic pointers.
D) All of the above.

5. Match the following
a) : :              i) Pointer to member declarator
b) : :*           ii) Pointer to member operator
c) ->*          iii) Scope resolution operator
A) a-ii, b-iii, c-i
B) a-iii, b-i, c-ii
C) a-i b-ii, c-iii
D) a-iii, b-ii, c-i

6. If m and n are int type variables, what will be the result of the expression
m% n when m=5 and n=2?
A) 0
B) 1
C) 2
D) None of the above

7. Some of the C++ operators cannot overloaded which are
i) Member access operators ( . And .* )       ii) Conditional operator ( ? : )
iii) Scope resolution operator ( : : )               iv) Size operator (sizeof)
A) only i, ii and iii
B) only ii, iii and iv
C) only ii and iv
D) All i, ii, iii and iv


8. Some of the situations where inline expansion may not work are:
A) For functions returning values, if a loop, a switch or goto exists.
B) If functions contain static variables and they are re-cursive.
C) For functions not returning values, if the return statement exist.
D) All of the above.

9. Which of the following control expressions are valid for an if statement?
A) an integer expression
B) a Boolean expression
C) either A or B
D) Neither A nor B

10. …………… is a way to bind the data and its associated functions together which allows the data and functions to be hidden.
A) Structure
B) Class
C) Enum
D) Both A and B

Read Also: Solved MCQ Questions on C++ Programming set-5

11. Procedure oriented programming basically consists of writing a list of instructions or actions for the computer to follow and organizing these instructions into groups known as ………………
A) procedures
B) functions
C) flowchart
D) instructions

12. State whether the following statements are true about object-oriented programming in C++.
i) Data is hidden and cannot be accessed by external functions.
ii) Follows the top-bottom approach in program design.
iii) Objects may communicate with each other through functions.
A) True, True, False
B) False, True, False
C) True, False, True
D) False, True, True

13. The wrapping up of data and functions into a single unit is known as ……………..
A) abstraction
B) inheritance
C) polymorphism
D) encapsulation

14. ……………… refers to the act of representing essential features without including the background details or explanations.
A) abstraction
B) inheritance
C) polymorphism
D) encapsulation

15. ……………. is the process by which objects of one class acquire the properties of objects of another class.
A) abstraction
B) inheritance
C) polymorphism
D) encapsulation

Answers

1. A) Simula67
2. C) C with classes
3. B) Identifiers
4. D) All of the above.
5. B) ii-False, ii-True
6. B) 1
7. D) All i, ii, iii and iv
8. D) All of the above.
9. B) a Boolean expression
10. B) Class
11. B) functions
12. C) True, False, True
13. D) encapsulation
14. A) abstraction
15. B) inheritance

Read Next: MCQ Questions On C++ With Answer Set-2
Read More: C and C++ MCQ Questions

Please follow and like us:
RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
linkedIn | Solved MCQ Questions On C++ Programming Set-1
Share

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Comments are closed.

RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
Share