MCQs
Total Questions : 9
Answer: Option B. -> 1
The main function is the mandatory part, it is needed for the execution of the program to start.
Answer: Option B. -> only inside the {} block
The variable is valid only in the function block as in other.
Answer: Option A. -> 10
In this program, we called by value so the value will not be changed, So the output is 10
Output:
$ g++ fun.cpp
$ a.out
10
Answer: Option C. -> compile time error
We have to use the semicolon to declare the function in line 3. If we did means, the program
will execute.
Answer: Option B. -> call by reference
In the call by reference, it will just copy the address of the variable to access it, so it will reduce
the memory in accessing it.
Answer: Option D. -> 127
None.
Answer: Option B. -> main function
Normally the execution of the program in c++ starts from main only.
Answer: Option C. -> ;
None.
Answer: Option A. -> return type,function name
In a function, return type and function name are mandatory all else are just used as a choice.