Factorial of any Number

/*Factorial*/
#include<stdio.h>
main()
{
int c, n, f = 1;
printf("Enter a number to calculate its factorial\n");
scanf("%d", &n);
for (c = 1; c <= n; c++)
f = f * c;
printf("Factorial of %d = %d\n", n, f);
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image