Which of the following is the best definition of a recursive method?

C++ Recursion

Quiz
•
Computers
•
12th Grade
•
Medium
Manoj R
Used 15+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A method that iterates itself exactly 5 times.
A method that invokes itself by name within the method.
A method that will never iterate infinitely.
A method that cannot be called more than once.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Name the condition at which the recursive method will stop calling itself.
Base case
Worst Case
Best Case
None of the above
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict output of following program
int fun(int n)
{
if (n == 4)
return n;
else
return 2*fun(n+1);
}
int main() {
printf("%d", fun(2)); return 0; }
4
8
16
None
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
int main()
{
printf("Hello");
main();
return 0;
}
Hello is printed once
Hello infinite number of times
Hello is not printed at all
0 is returned
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The data structure used to implement recursive function calls _____________
Array
Linked list
Binary tree
Stack
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the C keyword that must be used to get the expected result using Recursion?
printf
void
break
return
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following function finds the factorial of any number
int factorial(int n)
{
if(n == 0 || n == 1) return 1;
return n * factorial(n-1);
}
What would calling factorial(4) output?
24
16
8
64
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Recursion in Java

Quiz
•
11th - 12th Grade
16 questions
C-Programming Basics

Quiz
•
12th Grade
10 questions
Objects & Classes

Quiz
•
11th - 12th Grade
12 questions
Enumeration and Recursion

Quiz
•
11th Grade - University
12 questions
C++ References

Quiz
•
6th - 12th Grade
10 questions
Recursion in Java (AP Computer Science A)

Quiz
•
9th - 12th Grade
15 questions
Technical Quiz R2

Quiz
•
12th Grade
10 questions
Recursive Functions in Python

Quiz
•
12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University