#include<stdio.h>
#include<conio.h>
void main()
{
long int multiply,num;
long int i=0,a,value,sum;
clrscr();
printf("enter number which you find the factorial =");
scanf("%ld",& num);
multiply=num;
value=num;
a=num-1;
while(i++<a)
{
sum=value-i;
multiply=multiply*sum;
}
printf("%ld",multiply);
getche();
}
No comments:
Post a Comment