C Functions-2
1. What is the minimum number of functions to be present in a C Program?
a) 1
b) 2
c) 3
d) 4
Answer: A
At least there will be one function which is main() function.
2. What is the maximum number of statements that can present in a C function?
void main() {
printf("Hello");
}
a) 64
b) 128
c) 256
d) None of the above
Answer: D
There is no limit on the number of statements that can present in a C Function.
3. What characters are allowed in a C function name identifier?
a) Alphabets, Numbers, %, $, _
b) Alphabets, Numbers, Underscore ( _ )
c) Alphabets, Numbers, dollar $
d) Alphabets, Numbers, %
Answer: B
Remember that a C function name can not start with a number but it can contain contain numbers after 1st character is either an Underscore ( _ ) or an Alphabet.
4. Arguments passed to a function in C language are called ___ arguments.
int **a;
a) Formal arguments
b) Actual Arguments
c) Definite Arguments
d) Ideal Arguments
Answer: B
No explanation is given for this question.
5. Arguments received by a function in C language are called ___ arguments.
a) Definite arguments
b) Formal arguments
c) Actual arguments
d) Ideal arguments
Answer: B
No explanation is given for this question.
6. 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 the above
Answer: D
No explanation is given for this question.
7. Choose a non Library C function below.
a) printf()
b) scanf()
c) fprintf()
d) printf4()
Answer: D
No explanation is given for this question.
8. 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
Answer: B
By default, a return 0; is added at the end of any function if not explicitly specified.
9. It is necessary to declare the type of a function in the calling program if the function
a) Is not defined in the same file
b) Returns a non-integer value
c) Both A and B
d) None of the above
Answer: C
No explanation for this question.
10. 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
Answer: E
No explanation is given for this question.