Find Factorial of given number
#include<stdio.h>
int main()
{
int fact = 1, n, i;
printf("Enter a number to calculate factorial: ");
scanf("%d", &n);
for ( i = 1; i <= n; i++)
{
fact = fact * i;
}
printf("\nFactorial = %d", fact);
return 0;
}
Come again Learn again !
< icodebuzz />
No comments:
Post a Comment