C++ Question Bank
C++ Question Bank
a. Procedural Programming
b. Functional Programming
c. Object-Oriented Programming
d. Scripting Programming
Answer: c
Q2. What is a fundamental concept in OOP that represents a blueprint for creating objects?
a. Algorithm
b. Class
c. Function
d. Variable
Answer: b
b. Limited Reusability
c. Limited Encapsulation
d. Sequential Execution
Answer: a
a. C
b. Pascal
c. Java
d. Fortran
Answer: c
a. Web Development
c. Database Management
d. Network Protocols
Answer: a
Q6. In C++, which category includes words reserved for specific purposes and cannot be used as
identifiers?
a. Tokens
b. Keywords
c. Identifiers
d. Constants
Answer: b
Q7. Which type of constant in C++ is represented by a sequence of characters enclosed in double
quotes?
a. Integer Constant
b. Real Constant
c. Character Constant
d. String Constant
Answer: d
a. Escape Character
b. Division Operator
c. Concatenation Operator
d. Logical OR Operator
Answer: a
Q9. Which feature of C++ allows the combination of data and functions into a single unit?
a. Inheritance
b. Encapsulation
c. Polymorphism
d. Abstraction
Answer: b
Q10. What is the basic structure of a C++ program without using a class?
Answer: d
Q11. Which step involves translating the C++ source code into machine code?
a. Editing
b. Compiling
c. Linking
d. Executing
Answer: b
Q12. What is used to declare the type of data a variable can hold in C++?
a. Data Identifier
b. Data Type
c. Variable Type
d. Data Declaration
Answer: b
Q13. What are used for displaying output and taking input in C++?
Answer: a
a. int
b. float
c. char
d. double
Answer: a
b. Functions
c. Variables
d. Keywords
Answer: c
a. 123variable
b. _myVariable
c. float-variable
d. break
Answer: b
Q17. What is a value that does not change during the execution of a program called?
a. Variable
b. Constant
c. Identifier
d. Operator
Answer: b
a. +
b. -
c. *
d. (type)
Answer: d
c. During runtime
Answer: a
Q20. What is used for displaying output to the console in C++?
a. print
b. display
c. cout
d. output
Answer: c
a. +
b. -
c. *
d. /
Answer: d
Q22. What determines the order in which operators are evaluated in an expression?
a. Associativity
b. Precedence
c. Priority
d. Order
Answer: b
Q23. Which conditional statement is used for making decisions based on multiple conditions in C++?
a. if
b. switch
c. else
d. while
Answer: b
Q24. Which loop executes a block of code as long as a specified condition is true?
a. for
b. while
c. do...while
d. switch
Answer: b
Q25. Which data structure allows the storage of multiple values of the same type in C++?
a. Variables
b. Arrays
c. Strings
d. Functions
Answer: b
Q26. What type of array has a fixed size and cannot be changed during runtime in C++?
a. Static Array
b. Dynamic Array
c. Multidimensional Array
d. String Array
Answer: a
a. Data Storage
b. Code Compilation
d. Program Execution
Answer: c
Answer: a
a. Code Reusability
c. Polymorphism
d. Inheritance
Answer: b
a. Classes
b. Objects
c. Functions
d. Keywords
Answer: a
a. Class Functions
b. Member Functions
c. Object Functions
d. Method Functions
Answer: b
Answer: b
a. Default Constructor
b. Parameterized Constructor
c. Copy Constructor
d. Private Constructor
Answer: a
Q34. What are methods that allow reading or accessing the values of private data members in a class?
a. Accessor Methods
b. Mutator Methods
c. Static Methods
d. Private Methods
Answer: a
Q35. What keyword is used to declare a member variable or function as belonging to the class rather
than an instance of the class?
a. static
b. const
c. public
d. private
Answer: a