378 views
0 votes
0 votes

 

What does fun2() do in general?

int fun(int x, int y)

{

    if (y == 0)   return 0;

    return (x + fun(x, y-1));

}

 

int fun2(int a, int b)

{

    if (b == 0) return 1;

    return fun(a, fun2(a, b-1));

}

Please log in or register to answer this question.

Related questions

0 votes
0 votes
2 answers
1
Debargha Mitra Roy asked Apr 10
99 views
What is the output of the below code?#include <stdio.h void main() { static int var = 5; printf("%d ", var ); if (var) main(); }a. 1 2 3 4 5b. 1c. 5 4 3 2 1d. Error
3 votes
3 votes
3 answers
2
Laxman Ghanchi asked May 19, 2023
1,157 views
#include<stdio.h void print(int n) { printf("Hello "); if(n++ == 0) return ; print(n); n++; } int main() { void print(); print(-4); }How many times printf execute?? And H...
0 votes
0 votes
1 answer
3
Laxman Ghanchi asked May 19, 2023
682 views
#include<stdio.h>void print(int n){ printf("Hello "); if(n++ == 0) return ; print(n); n++;}int main(){ void print(); print(-4);}