#include

#include

int fact(int);

void main()

{

int num,fact1;

printf("Enter a value of num");

scanf("%d",&num);

fact1=fact(num);

printf("factorial=%d",fact1);

getch();

}

int fact(int n)

{

int f=1;

if(n==0)

{

return 1;

}

else

{

f=n*fact(n-1);

return(f);

}

}

#include

int fact(int);

void main()

{

int num,fact1;

printf("Enter a value of num");

scanf("%d",&num);

fact1=fact(num);

printf("factorial=%d",fact1);

getch();

}

int fact(int n)

{

int f=1;

if(n==0)

{

return 1;

}

else

{

f=n*fact(n-1);

return(f);

}

}

## No comments:

## Post a Comment