#include <stdio.h>
#include <conio.h>
unsigned long fact(int);
void main()
{
unsigned long f;
int n;
clrscr();
printf(“\nEnter a number: “);
scanf(“%d”,&n);
f=fact(n);
printf(“\nFactorial of %d is %ld”,n,f);
getch();
}
unsigned long fact(int n)
{
unsigned long m;
if(n==1)
return(1);
else
m=n*fact(n−1);
return(m);
}
The Execution of the program to find the factorial of 6 is yields:-
Enter a Number:
6
Factorial of 6 is 720
#include <stdio.h>
#include <conio.h>
unsigned long ...
No credit card required