Home
MCQS
C/C MCQ Quiz Hub
C programming language MCQ Questions Set 5
Choose a topic to test your knowledge and improve your C/C skills
1. How many minimum number of functions should be present in a C++ program for its execution?
0
1
2
3
2. Which of the following is the default return value of functions in C++?
int
char
float
void
3. What happens to a function defined inside a class without any complex operations (like looping, a large number of lines, etc)?
It becomes a virtual function of the class
It becomes a default calling function of the class
It becomes an inline function of the class
The program gives an error
4. What is an inline function?
A function that is expanded at each call during execution
A function that is called during compile time
A function that is not checked for syntax errors
A function that is not checked for semantic analysis
5. When we define the default values for a function?
When a function is defined
When a function is declared
When the scope of the function is over
When a function is called
6. Where should default parameters appear in a function prototype?
To the rightmost side of the parameter list
To the leftmost side of the parameter list
Anywhere inside the parameter list
Middle of the parameter list
7. If an argument from the parameter list of a function is defined constant then ______
It can be modified inside the function
It cannot be modified inside the function
Error occurs
Segmentation fault
8. Which of the following feature is used in function overloading and function with default argument?
Encapsulation
Polymorphism
Abstraction
Modularity
9. From which function the execution of a C++ program starts?
start() function
main() function
new() function
end() function
10. Which of the following is important in a function?
Return type
Function name
Both return type and function name
The return type, function name and parameter list
11. Which is used to keep the call by reference value as intact?
static
const
absolute
virtual
12. By default how the value are passed in c++?
call by value
call by reference
call by pointer
call by object
13. What will happen when we use void in argument passing?
It will not return value to its caller
It will return value to its caller
Maybe or may not be return any value to its caller
It will return value with help of object
14. Where does the return statement returns the execution of the program?
main function
caller function
same function
block function
15. When will we use the function overloading?
same function name but different number of arguments
different function name but same number of arguments
same function name but same number of arguments
different function name but different number of arguments
16. If the user did not supply the value, what value will it take?
default value
rise an error
both default value & rise an error
error
17. Where can the default parameter be placed by the user?
leftmost
rightmost
both leftmost & rightmost
topmost
18. Which value will it take when both user and default values are given?
user value
default value
custom value
defined value
19. What we can’t place followed by the non-default arguments?
trailing arguments
default arguments
both trailing & default arguments
leading arguments
20. If we start our function call with default arguments means, what will be proceeding arguments?
user argument
empty arguments
default arguments
user & empty arguments
21. What is the default return type of a function?
int
void
float
char
Submit