What will be the output of the following C code? #include<stdio.h> int fun(int…

PYQ Hexaware Hiring Assessment 2023PYQ CoCubes 2023

What will be the output of the following C code?

#include<stdio.h>
int fun(int x, int y);
int main()
{
    int i,n;
    i=5;
    n=7;
    int f = fun(5,7);
    printf("%d", f);
}
int fun(int x, int y)
{
    if(x<=0)
        return y;
    else
        return(fun(x-1,y-1));
}
  1. A.

    0

  2. B.

    1

  3. C.

    2

  4. D.

    3

Attempted by 48 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…