True / False Questions

Question 1 :

A function cannot be defined inside another function


A). True
B). False
Answer : Option A

Explanation :

A function cannot be defined inside the another function, but a function can be called inside a another function.


Question 2 :

Functions cannot return more than one value at a time


A). True
B). False
Answer : Option A

Explanation :

True, A function cannot return more than one value at a time. because after returning a value the control is given back to calling function.


Question 3 :

If return type for a function is not specified, it defaults to int


A). True
B). False
Answer : Option A

Explanation :

True, The default return type for a function is int.


Question 4 :

In C all functions except main() can be called recursively.


A). True
B). False
Answer : Option B

Explanation :

Any function including main() can be called recursively.


Question 5 :

Functions can be called either by value or reference


A). True
B). False
Answer : Option A

Explanation :

True, A function can be called either call by value or call by reference.

Example:
Call by value means c = sub(a, b); here value of a and b are passed.
Call by reference means c = sub(&a, &b); here address of a and b are passed.


Question 6 :

A function may have any number of return statements each returning different values.


A). True
B). False
Answer : Option A

Explanation :

True, A function may have any number of return statements each returning different values and each return statements will not occur successively.


Question 7 :

Names of functions in two different files linked together must be unique


A). True
B). False
Answer : Option A

Explanation :

True, If two function are declared in a same name, it gives "Error: Multiple declaration of function_name())".