1/28
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Which of the following is the correct syntax to include a header file in C++?
B. #include
3 multiple choice options
Which operator is used to access members of a class using a pointer?
C. ->
3 multiple choice options
What is the default return type of the main() function?
B. int
3 multiple choice options
How many times will the loop run?
for (int i = 0; i < 5; i++);
C. 5
3 multiple choice options
Which of the following is NOT a loop control statement?
D. switch
3 multiple choice options
Which of the following is NOT a principle of OOP?
C. Compilation
3 multiple choice options
Which access specifier allows access from anywhere?
C. Public
3 multiple choice options
What is function overloading?
A. Same name, different parameters
3 multiple choice options
Which is a feature of polymorphism?
D. All of the above
3 multiple choice options
What will sizeof(char) return?
B. 1
3 multiple choice options
The keyword used to define a constant in C++ is
const
The conditional (ternary) operator is written as
condition ? expression if true : expression if false
The keyword _____________ is used to skip the current iteration of a loop.
continue
A do-while loop executes at least _____________ time(s)
one
A class is a _____________ for creating objects
blueprint
The process of hiding data members inside a class is called _____________.
encapsulation
When a function in a base class is redefined in a derived class, it is called _____________.
function overloading
The virtual keyword is used to implement _____________ polymorphism
runtime
. A pointer stores the _____________ of another variable.
address
new is used for _____________ memory allocation
dynamic
cin is used to display output in C++. (T/F)
false
1 multiple choice option
for, while, and do-while are looping constructs. (T/F)
true
1 multiple choice option
switch can evaluate both int and float types. (T/F)
false
1 multiple choice option
Private members of a class are accessible outside the class. (T/F)
false
1 multiple choice option
A derived class can access protected members of the base class. (T/F)
true
1 multiple choice option
Constructors can be overloaded in C++. (T/F)
true
1 multiple choice option
Destructors can take parameters. (T/F)
false
1 multiple choice option
You must use delete with new to avoid memory leaks. (T/F)
true
1 multiple choice option
static members are shared across all objects of a class. (T/F)
true
1 multiple choice option