Chapter - 6: Functions And Pointers

State whether the following statements are True or False:


C
Sections
2
Exercises

1. The variables commonly used in C functions are available to all the functions in a program.

False: Scope of variables local to a function is not available in other functions.

 

2. To return the control back to the calling function we must use the keyword return.

False: It is not necessary to use the return keyword. After the execution of the last statement of the called function, control goes back to calling function even without the use of the return statement, if the return type of the function is void.

 

3. The same variable names can be used in different functions without any conflict.

True.

 

4. Every called function must contain a return statement.

False: Not in the case of void returning functions.

 

5. A function may contain more than one return statements. 

True.

 

6. Each return statement in a function may return a different value.

True: But datatype should remain the same as the return type of function.

 

7. A function can still be useful even if you don’t pass any arguments to it and the function doesn’t return any value back.

True.

 

8. Same names can be used for different functions without any conflict.

False: Functions with the same name are not allowed in C.

 

9. A function may be called more than once from any other function.

True.

 

10. It is necessary for a function to return some value. 

False: A function may also have a void return type.


© 2021 Garbage Valuegarbage value logo