- A4444........until stack overflow
- B4321
- CCompiler error
- DLinker Error
Answer: C) A function that calls itself. A recursive function is a function that calls itself either directly or indirectly. It is useful for solving problems that can be broken down into smaller sub-problems that are identical or similar in nature to the original problem.
Answer: d. buit
Explanation: In C language, a function can return any data type including int, void, float, double, char, pointers, structures, and unions. However, buit is not a valid data type for function return value.
Answer: b. A recursive function must have a base case to terminate the recursion.
Explanation: A recursive function is a function that calls itself. To prevent infinite recursion, a recursive function must have a base case that terminates the recursion. The base case is a condition that is tested at each recursive call to determine whether the recursion should continue or terminate.
Answer: c. Function arguments can be passed by value or by reference.
Explanation: In C language, function arguments can be passed by value or by reference. When an argument is passed by value, a copy of the argument value is passed to the function. When an argument is passed by reference, a reference to the argument variable is passed to the function.
Answer: c. To declare the function name and its parameter types.
Explanation: A function prototype is a declaration of the function name and its parameter types, but not its implementation or return type. It allows the compiler to know about the function before it is called, so that it can perform type checking and generate appropriate code.
Answer: b. Call by value passes a copy of the argument value to the function, while call by reference passes a reference to the argument variable.
Explanation: In call by value, a copy of the argument value is passed to the function, while in call by reference, a reference to the argument variable is passed to the function. Call by reference allows the function to modify the argument variable, while call by value does not.
Answer: D) Both A and B.
A function in C can have either a return type of void
or an integer type (int
, char
, short
, long
, etc.) or a pointer type.