C. RECURSION
Posted: Tue Jul 05, 2022 10:26 am
C. RECURSION
FE-RECURSION-01 If i = 6), how many times will the program be entering the else statement in line 7)? If the program results to an infinite recursion, write INFINITE RECURSION as your answer. 1 #include<stdio.h> 2 int f(int x) 47{ 5 6 8 9 if(x==2) 22 23 } else { return 2; 10 11 12 13 14 int main() 15 { 16 17 18 19 20 21 } printf("*"); f(x-1); int n, i; scanf("%d", &i); n=f(i); printf("%d",n); return 0;
FE-RECURSION-01 If i = 6), how many times will the program be entering the else statement in line 7)? If the program results to an infinite recursion, write INFINITE RECURSION as your answer. 1 #include<stdio.h> 2 int f(int x) 47{ 5 6 8 9 if(x==2) 22 23 } else { return 2; 10 11 12 13 14 int main() 15 { 16 17 18 19 20 21 } printf("*"); f(x-1); int n, i; scanf("%d", &i); n=f(i); printf("%d",n); return 0;