What is an inline function in C++?
A function that does not return any value.
A function that is declared with the 'inline' keyword, which serves as a request to the compiler to replace the function call with its actual code.
A function that is defined inside another function.
A function that takes another function as a parameter.
What is the purpose of the 'break' statement in a switch-case statement?
To jump to a specific case statement
To exit the switch-case statement
To skip to the next case statement
To repeat the current case statement
What is the output of the following C++ code snippet?
int x = 5; if (x > 10) { x = 10; } else if (x < 0) { x = 0; } cout << x;
5
None of the above
10
0
What is a pure virtual function in C++?
A function that can be called before an object is created
A function with no implementation in the base class, meant to be overridden by derived classes
A function that automatically destroys an object
A function that creates new data types
Which statement is used to display output to the console in C++?
print
cout
printf
cin
What is the concept of abstraction in OOP?
Using virtual functions for polymorphism
Hiding complex implementation details and exposing only essential information
Implementing multiple inheritance
Creating objects from a class
Which data type is used to store whole numbers without any decimal points?
double
int
string
float
Which of these is NOT a benefit of using functions in programming?
Improved code organization
Easier debugging and maintenance
Code reusability
Increased memory usage
What is the output of the following code snippet?
int arr[] = {10, 20, 30}; int *ptr = arr; cout << *(ptr + 2);
20
Invalid memory access
30
Which statement is used to skip the rest of the current iteration in a loop and jump to the next iteration?
skip
goto
break
continue