Ads 468x60px

Labels

Jun 7, 2012

#9 - Factorial Of A Number [C]

#include"stdio.h"
void main()
{
int i,n,fact=1;
clrscr();
printf("Enter the number \n");
scanf("%d",&n);
for(i=1; i<=n; i++)
fact = fact*i;
printf("Factorial of %d is %d\n",n,fact);
getch();
}

No comments:

Post a Comment