ago
76 views

1 Answer

Best answer
6 votes
6 votes

The invocations of function call will look like this :

 

 

After Invocation of Sum(5) it will keep on calling Sum(2) again and again. After sometime stack will be 

full and program will terminate abnormally without printing anything on the screen.

ago selected ago by

Related questions

494
views
3 answers
6 votes
GO Classes asked Apr 24, 2022
494 views
What will be the output of the following program?#include<stdio.h> int rec(int x, int y) { static int count = 0; if (x == 0) return count; count++; if (x > y) rec(x - y, y ... j = 2, n; n = rec(i, j); printf("%d", n); }$4$5$6$Infinite loop
360
views
1 answers
6 votes
GO Classes asked Apr 24, 2022
360 views
What will be the output of the program below-int i = 1; void my_extern1(void); void my_extern2(void); int main() { int count = 0; while (i++<5) { static int i = ... (){ extern int i; if (i++ < 3) my_extern1(); }Infinite recursion$9$4$5$