You are on page 1of 3

C++ Functions

MCQs
MCQs

Q1- Which of the following function(s) cannot have default parameters?

A. Any function
B. Main()
C. None
D. Both B and C

Q2. - The scope of the variable declared in the user-defined function is :

A. entire program
B. inside the {} block
C. inside main function
D. None of the above

Q3- Minimum number of functions present in C++ is/are :

A. 0
B. 3
C. 2
D. 1

Q4- Default values for a function are specified at the time of

A. function definition
B. function declaration
C. Both a and b
D. None of these

Q5- Standard functions are declared and defined inside :

A. Library files
B. Inside program
C. Inside compiler
D. None

Cracking the Coding Interview in C++ - Foundation


MCQs

Answers:
Ans 1 : B) Main()
Ans 2 : B) the variable is valid only in the function block as in other.
Ans 3 : D) main() function is mandatory, execution starts with this function.
Ans 4 : B) function declaration
Ans 5 : A) Library files

Cracking the Coding Interview in C++ - Foundation

You might also like