#include<stdio.h>
#include<conio.h>
Long factorial(int);
void main()
{
int n;
long fact=1;
clrscr();
printf("enter
no");
scanf("%d",&n);
fact=factorial(n);
printf("Factorial is
%ld ",fact);
getch();
}
long factorial(int n)
{
int i;
Long fact;
for(i=1;i<=n;i++)
{
fact=fact*i;
}
}
No comments:
Post a Comment