How many return statements can a C function have?
How many return statements can a C function have?
Answer: C. As many as needed — A C function can have as many return statements as needed. Execution will exit the function as soon as one of the return statements is reached.
- A.
Only one
- B.
Up to two
- C.
As many as needed
- D.
None
Attempted by 34 students.
Show answer & explanation
Correct answer: C
A C function can have as many return statements as needed. Execution will exit the function as soon as one of the return statements is reached.
Loading lesson…