C Programming - Functions
|
|
|
|
Exercise"Love is like a war, Easy to begin Hard to end."
- (Proverb)
|
| 1. |
A function cannot be defined inside another function |
Answer: Option C
Explanation:
A function cannot be defined inside the another function, but a function can be called inside a another function.
|
| 2. |
Functions cannot return more than one value at a time |
Answer: Option D
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.
|
| 3. |
If return type for a function is not specified, it defaults to int |
Answer: Option B
Explanation:
True, The default return type for a function is int.
|
| 4. |
In C all functions except main() can be called recursively. |
Answer: Option B
Explanation:
Any function including main() can be called recursively.
|
| 5. |
Functions can be called either by value or reference |
Answer: Option B
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.
|
|
|