Monday, July 8, 2019

c interview questions 12

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int x=5;
    func1(x) ;

    return 0;
}

func1(int a)
{
    printf("Value of a=%d\n",a);
    if(a>0)
        {func2(--a);}
}

func2(int b)
{
    printf("Value of b=%d\n",b);
    if (b>0)
       {func1(--b);}
}

output::

Value of a=5
Value of b=4
Value of a=3
Value of b=2
Value of a=1
Value of b=0

No comments:

Post a Comment

python class topic video