#include "stdio.h"
#include "conio.h"
void main()
{
long unsigned int accpt();
long unsigned int cal();
void disp();
clrscr();
disp();
getch();
}
long unsigned int accpt()
{
long unsigned int n;
printf("Enter a number");
scanf("%ld", &n);
return(n);
}
long unsigned int cal()
{
long unsigned int fact=1, i;
for(i=accpt(); i>0; i--)
{
fact*=i;
}
return(fact);
}
void disp()
{
long unsigned int s=cal();
printf("The Factorial is %lu", s);
}
0 comments:
Post a Comment