Department of Computer Engineering
Academic Year 2020-21
Class: Computer & IT
Subject: 22226 PCI (Programming in C) MCQ
Unit 5: Functions
MCQ Question Bank with Answers
2nd SEM ALL SUBJECT MCQ: click here
To Download PDF scroll to the bottom
1. The keyword used to transfer control from a function back to the calling function is
A. switch
B. goto
C. return
D. exit
Ans : C
2. What is the default return type if it is not specified in function definition?
A. void
B. int
C. float
D. short int
Ans : B
3. The default parameter passing mechanism is
A. Call by value
B. call by reference
C. call by value result
D. None
Ans : A
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. 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
Ans : C
5. Functions can return structure in c?
A. TRUE
B. FALSE
C. May Be
D. Can't Say
Ans : A
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
Ans : C
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.
Ans : B
8. Choose the 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 the above
Ans: d
9. Choose a correct statement about C Function?
void main() {
printf("Hello");
}
a) "main" is the name of default must and should Function
b) main() is same as int main()
c) By default, return 0 is added as the last statement of a function without specific return type
d) All the above
Ans: d
10. A function which calls itself is called a ___ function.
a) Self Function
b) Auto Function
c) Recursive Function
d) Static Function
Ans: c
11. 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
Ans: c
12. What is the limit for number of functions in a C Program?
a) 16
b) 31
c) 32
d) No Limit
Ans: d
13. Every C Program should contain which functionEvery C Program should contain which function?
a) printf()
b) show()
c) scanf()
d) main()
Ans: d
14. What characters are allowed in a C function name identifier?
a) Alphabets, Numbers, %, $, _
b) Alphabets, Numbers, Underscore ( _ )
c) Alphabets, Numbers, dollar $
d) Alphabets, Numbers, %
Ans: b
15. Choose a correct 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 the above
Ans: d
Download
Happy Learning!
Declaration: The above data is scraped from the webistes for education purpose all right goes to them.
Thank you very much ...all mcqs are very usefully .......
ReplyDelete