R

Ram Sharma • 193.86K Points
Coach

Q. What is the output of C Program with recursive function?

Code:
int sum(int);
int main()
{
    int b;
    b = sum(4);
    printf("%d", b);
    
}
int sum(int x)
{
    int k=1;
    if(x<=1)
     return 1;
    k = x + sum(x-1);
    return k;
}
  • (A) 10
  • (B) 11
  • (C) 12
  • (D) 13

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics