C++ MCQ Questions and Answers
Practice ModeShowing 10 of 93 questions
Q71
Observe the following block of code and determine what happens when x=2?
switch (x){
case 1:
case 2:
case 3:
cout<< "x is 3, so jumping to third branch";
goto thirdBranch;
default:
cout<<"x is not within the range, so need to say Thank You!";
}
Answer: Option C
Q72
Observe the following block of code and determine what happens when x=2?
switch (x){
case 1:
case 2:
case 3:
cout<< "x is 3, so jumping to third branch";
goto thirdBranch;
default:
cout<<"x is not within the range, so need to say Thank You!";
}
Answer: Option C
Q73
Which of the following is false for switch statement in C++?
Answer: Option C
Q74
The void specifier is used if a function does not have return type.
Answer: Option A
Q75
You must specify void in parameters if a function does not have any arguments.
Answer: Option B
Q76
Type specifier is optional when declaring a function
Answer: Option B
Q77
Study the following piece of code and choose the best answer
int x=5, y=3, z;
a=addition(x,y)
Answer: Option A
Q78
In case of arguments passed by values when calling a function such as z=addidion(x,y),
Answer: Option A
Q79
If the type specifier of parameters of a function is followed by an ampersand (&Wink, that function call is
Answer: Option B
Q80
In case of pass by referenc
Answer: Option B