How many return statements can a C function have?

How many return statements can a C function have?

Answer: C. As many as neededA 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.

  1. A.

    Only one

  2. B.

    Up to two

  3. C.

    As many as needed

  4. 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.

Explore the full course: Isro

Loading lesson…