Examveda
Examveda

Pick the correct statements.
I.   The body of a function should have only one return statement.
II.  The body of a function may have many return statements.
III. A function can return only one value to the calling environment.
IV. If return statement is omitted, then the function does its job but returns no value to the calling environment.

A. I and II

B. I and III

C. II and III

D. II and IV

E. III and IV

Answer: Option C


This Question Belongs to C Program >> Function

Join The Discussion

Comments ( 8 )

  1. Lucky Nirala
    Lucky Nirala :
    3 years ago

    What will be the output of the following C code? #include void main() { int a[2][3] = {1, 2, 3, 4, 5}; int i = 0, j = 0; for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) printf("%d", a[i][j]); }

  2. Neeraja Sanapala
    Neeraja Sanapala :
    4 years ago

    I think option || is wrong and |V is correct

  3. Abishek R
    Abishek R :
    5 years ago

    a function can return only one value

  4. Harsh Hitesh
    Harsh Hitesh :
    6 years ago

    if we only add printf or scanf function inside function (which we have defined),and not writing return statement ,then also function works.

    so 4th option should be correct.

  5. Swathi Gowroju
    Swathi Gowroju :
    6 years ago

    I feel that , IV option is also true. Its not mandatory to keep a return statement for a function in C. even if we didn't specify return statement, function will do its job and returns to calling function. In this process function returns no value to calling environment.

  6. Pratiksha Rao
    Pratiksha Rao :
    7 years ago

    I didnt get this...

  7. Umang Mahant
    Umang Mahant :
    7 years ago

    seriously??how??

  8. Shyam Modanwal
    Shyam Modanwal :
    8 years ago

    how it is please explane
    it

Related Questions on Function