GATE CSE C Programming Practice Test – Data Types & Operators | Set 1

Questions 46-50 of 100

Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 46

MCQ · Single Correct 1 mark

What is the primary condition required in a recursive function to prevent infinite recursion?

Answers for question 46

Question 47

MCQ · Single Correct 1 mark

What will be the output of the recursive function call 'fun(3)'?

JAVASCRIPT
int fun(int n) {
    if (n <= 0) return 0;
    return n + fun(n - 1);
}
Answers for question 47

Question 48

MCQ · Single Correct 1 mark

What memory structure is used by the execution environment to track active recursive function calls?

Answers for question 48

Question 49

MCQ · Single Correct 1 mark

What is tail recursion?

Answers for question 49

Question 50

MCQ · Single Correct 1 mark

What output is generated by calling 'solve(4)'?

C
#include <stdio.h>
void solve(int n) {
    if (n == 0) return;
    solve(n - 1);
    printf("%d ", n);
}
Answers for question 50
Scroll to Top