Program for Factorial


Program for Factorial
/*factorial*/
#include<stdio.h>
#include<conio.h>
main()
{
int i,n,f=1;
clrscr();
printf("enter the value of n");
scanf("%d",&n);
for(i=1;i<=n;++i)
{
f=f*i;
}
printf("%d",f);
getch();

}

No comments:

Post a Comment