100% found this document useful (1 vote)
522 views3 pages

MCQs - Functions PDF

This document contains multiple choice questions about C++ functions. It asks about which functions can have default parameters (main cannot), the scope of variables declared in functions (inside the curly braces), the minimum number of functions in C++ (main is required), where default values are specified (declaration), and where standard functions are declared (library files). The answers to each question are also provided.

Uploaded by

Shourya Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
522 views3 pages

MCQs - Functions PDF

This document contains multiple choice questions about C++ functions. It asks about which functions can have default parameters (main cannot), the scope of variables declared in functions (inside the curly braces), the minimum number of functions in C++ (main is required), where default values are specified (declaration), and where standard functions are declared (library files). The answers to each question are also provided.

Uploaded by

Shourya Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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