0% found this document useful (0 votes)
34 views7 pages

MCQs

The document contains multiple choice questions about functions in C language. It covers topics like function definition, return types, arguments, scope, recursion and more. There are 27 questions in total testing one's understanding of functions in C.

Uploaded by

Arshia Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views7 pages

MCQs

The document contains multiple choice questions about functions in C language. It covers topics like function definition, return types, arguments, scope, recursion and more. There are 27 questions in total testing one's understanding of functions in C.

Uploaded by

Arshia Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

MCQs on Topic Function in C Language

1. Choose correct statement about Functions in C Language.

a) A Function is a group of c statements which can be reused any


number of times
b) Every Function has a return type
c) Every Function May No may not return a value
d) All of the above

2. The keyword used to transfer control from a function back to the


calling function is

a) switch
b) goto
c) go back
d) return

3. What are the types of functions in C Language?

a) Library Functions
b) User Defined Functions
c) Both Library and User Defined
d) None of the above

4. Choose correct statements about C Language Pass By Value.

a) Pass By Value copies the variable value in one more memory location
b) Pass By Value does not use Pointers
c) Pass By Value protects your source or original variables from changes
in outside functions or called functions
d) All the above

5. What is the limit for number of functions in a C Program?


a) 16
b) 31
c) 32
d) No Limit

6. Every C Program should contain which function Every C


Program should contain which function?

a) printf()
b) show()
c) scanf()
d) main()

7. What is the minimum number of functions to be present in a C


Program?

a) 1
b) 2
c) 3
d) 4

8. Arguments passed to a function in C language are called ___


arguments.

a) Formal arguments
b) Actual Arguments
c) Definite Arguments
d) Ideal Arguments

9. Arguments received by a function in C language are called ___


arguments.

a) Definite arguments
b) Formal arguments
c) Actual arguments
d) Ideal arguments
10. Choose a corrects statement about C language function
arguments.

a) Number of arguments should be same when sending and receiving


b) Type of each argument should match exactly
c) Order of each argument should be same
d) All of the above

11. Choose a non-Library C function below.

a) printf()
b) scanf()
c) fprintf()
d) printf4()

12. What is the default return value of a C function if not specified


explicitly?

a) -1
b) 0
c) 1
d) None of the above

13. Uses of function

a) Helps to avoid repeating a set of statements many times


b) Enhances the logical clarity of the program
c) Helps to avoid repeated programming across programs
d) Makes the debugging task easier
e) All of the above

14. A recursive function can be replaced with __ in C language.

a) for loop
b) while loop
c) do while loop
d) All the above
15. A recursive function is faster than __ loop.

a) for
b) while
c) do while
d) None of the above

16. What is the C keyword that must be used to achieve expected


result using Recursion?

a) printf
b) scanf
c) void
d) return

17. In C language how are function arguments passed by default?

a. Call By Value

b. Call By Reference

c.By Pointer

d. By Address

18. What is a Function’s return type in C if it does not return any value?

a. int

b. void

c. float

d. char

19. In C what is a function’s prototype?


a. A function’s name and return type

b.A declaration that specifies a function’s name and parameters

c.A function’s documentation

d. A function’s source code

20. Which is not a correct function declaration?


(a) int funct(char x, char y);
(b)double funct(x)
(c) void funct();
(d) char x();
21. Function have______
(a) Local scope
(b) Block scope
(c) File scope
(d) No scope

22 .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

23. Which of the following is a valid function call (assuming the function exists)?
(a) funct;
(b) funct x, y;
(c) funct();
(d) int funct();
24. What is the default return type if it is not specified in function
definition?

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

25. A function which calls itself is called a ___ function.


A) Self Function
B) Auto Function
C) Recursive Function
D) Static Function

26. How many values can a C Function return at a time?


(a) Only one value
(b) Maximum of two values
(c) Maximum of three values
(d) Any number of values

27. Which of the following is a correct format for declaration of


function?
a) return-type function-name(argument type);
b) return-type function-name(argument type){}
c) return-type (argument type)function-name;
d) all of the mentioned

You might also like