Table of Contents

Factorial Number

Program to find the factorial number in C language.
#include<stdio.h>
#include<conio.h>
void main()

{
int i,fact=1,number;
printf("Enter a number: ");
scanf("%d",&number);
for(i=1;i<=number;i++)
{
fact=fact*i;
}
printf("Factorial of %d is: %d",number,fact);

getch();
}
Output

                 Enter a number: 6

                 Factorial if 6 is 720