Write a program in C program to find factorial of a number

/**  program to find factorial of a number**/

#include <stdio.h>

int main()
{
int number,k;
long int fact;

printf(“Enter an integer number: “);
scanf(“%d”,&number);

/*product of numbers from num to 1*/
fact=1;
for(i=number; k>=1; k–)
fact=fact*k;

printf(“\nFactorial of %d is = %ld”,number,fact);

return 0;
}

Leave a Reply

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