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