C Programming Multiple Choice Question - Functions And Pointers

This section focuses on the "Functions And Pointers" of the C programming. These Multiple Choice Questions (mcq) should be practiced to improve the C programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. The keyword used to transfer control from a function back to the calling function is

A. switch
B. goto
C. return
D. exit

View Answer

2. What is the default return type if it is not specified in function definition?

A. void
B. int
C. float
D. short int

View Answer


3. The default parameter passing mechanism is

A. Call by value
B. call by reference
C. call by value result
D. None

View Answer


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

View Answer


5. Functions can return structure in c?

A. True
B. False

View Answer


6. Forward declaration is absolutely necessary

A. If a function returns a non-integer quantity
B. If the function call precedes its definition
C. If the function call precedes its definition and the function returns a non integer quantity
D. None of the above

View Answer


7. In C, what is the meaning of following function prototype with empty parameter list
void fun()
{
/* .... */
}

A. Function can only be called without any parameter
B. Function can be called with any number of parameters of any types
C. Function can be called with any number of integer parameters.
D. Function can be called with one integer parameter.

View Answer


8. A pointer is

A. A variable that stores address of an instruction
B. A variable that stores address of other variable
C. A keyword used to create variables
D. None of these

View Answer


9. The reason for using pointers in a Cprogram is

A. Pointers allow different functions to share and modify their local variables.
B. To pass large structures so that complete copy of the structure can be avoided.
C. Pointers enable complex “linked" data structures like linked lists and binary trees.
D. All of the above

View Answer


10. How can you write a[i][j][k][l] in equivalent pointer expression?

A. (((***(a+i)+j)+k)+l)
B. ((**(*(a+i)+j)+k)+l)
C. (*(*(*(a+i)+j)+k)+l)
D. *(*(*(*(a+i)+j)+k)+l)

View Answer







Also check :


Discussion


* You must be logged in to add comment.