Summative #7 Flashcards
What are the mandatory parts of a function declaration?
return type and function name
A function that can be made to return a single value to the calling program.
void
The program that calls a function is often referred to as the calling program.
True
Recursion is a method in which the solution of a problem depends on ____________
the solutions to smaller instances of the same problem.
Which data structure is used to perform recursion?
Stack
Which of the following problems can’t be solved using recursion?
Problems without base case
The case in which the routine calls itself to perform a subtask is called as
recursive case
Recursion is similar to which of the following?
a loop
Which of the following problems can be solved using recursion?
i. Factorial of a number
ii. Nth Fibonacci number
iii. Length of a string
The correspondence between actual and formal parameter is one-to-one basis according to the respective orders.
True
Function prototype provides the basic information about a function which tells the compiler that the function is used correctly or not.
True
A function that can be made to return a single value to the calling program is referred to as void function.
True
The function prototype contains different information than the function header contains.
False
If a variable is declared inside a function, what kind of variable is this?
Local Variable
If the function returns a value then the return_type must be void.
False
The following are problems that often have simple recursive solutions except ________.
display an output
Recursion itself cannot be used as a replacement to iteration or looping
False
The recursive routine always contains a selection statement-either an “if” or a “switch”.
True