Programming for Problem Solving (3110003) MCQs

MCQs of Functions

Showing 1 to 10 out of 29 Questions
1.
What is the default return type if it is not specified in function definition?
(a) void
(b) int
(c) float
(d) None of these
Answer:

Option (b)

2.
Every C Program should contain which function?
(a) printf()
(b) show()
(c) scanf()
(d) main()
Answer:

Option (d)

3.
Any C Program
(a) Must contain at least one function
(b) Need not contain any function
(c) Needs input data
(d) None of these
Answer:

Option (a)

4.
Function have______
(a) Local scope
(b) Block scope
(c) File scope
(d) No scope
Answer:

Option (c)

5.
Which is not a correct function declaration?
(a) int funct(char x, char y);
(b) double funct(x)
(c) void funct();
(d) char x();
Answer:

Option (b)

6.
06 What is the return type of the function with declaration:
int func(char x, float v, double t);
(a) char
(b) int
(c) float
(d) double
Answer:

Option (b)

7.
Which of the following is a valid function call (assuming the function exists)?
(a) funct;
(b) funct x, y;
(c) funct();
(d) int funct();
Answer:

Option (c)

8.
In C, function parameters are always
(a) Passed by value
(b) Passed by reference
(c) Passed by value result
(d) None of these
Answer:

Option (a)

9.
What is use of functions?
(a) Helps to avoid repeating a set of statements many times
(b) Enhances the logical clarity of the program
(c) Makes debugging task easy
(d) All of these
Answer:

Option (d)

10.
Arguments passed to a function in C language are called ____
(a) Formal arguments
(b) Actual arguments
(c) Definite arguments
(d) Ideal arguments
Answer:

Option (b)

Showing 1 to 10 out of 29 Questions