C Language - Functions

You Are Here :: Home > C Language > Functions - General Questions

 
7.

Pick the correct statement

If a call to gets is not successful, what gets returned?
1.The body of function should have only one return statement
2.The body of function may have many return statements
3.The function can return only one value to the calling environment
4.If return statement is missing then the function does its job but doesn't return any value to the calling environment

A. 1,2 B. 2,3
C. 3,4 D. 4,1




8.

The default parameter passing mechanism is ?

A. Call by value B. Call by reference
C. Call by value result D. None of the above




9.

Which of the following statements are correct ?

1.It is possible for a function to access a variable that is local to another function
2.Two local variable may have the same name
3.The scope of local variable should be a function
4.The scope of local variable may be a single statement

A. 1,2 B. 1,3
C. 1,4 D. None of the above




10.

Which one of the following sentences is true?

A. Function calls always use the call-by-value method. B. All functions must have prototypes.
C. All the arguments of a function must be of the same data type. D. Passing an array to a function involves a pointer.




11.

Difference between calloc() and malloc()

A. calloc() takes a single argument while malloc() needs two arguments B. malloc() takes a single argument while calloc() needs two arguments
C. malloc() initializes the allocated memory to ZERO D. calloc() initializes the allocated memory to NULL




12.

calloc() belongs to which library

A. stdlib.h B. malloc.h
C. calloc.h D. None of above




« previous

1

2

3

4

5

6

7

8

9

...

next »

 
 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on