PROGRAM TO FIND FACTORIAL OF A NUMBER IN C
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,f,n;
printf("Enter any number:");
scanf("%d",&n);
f=n;
for(i=1; i<=n; i++)
{
f=f*i;
}
printf("Factorial is: %d",f);
getch();
}
printf("Enter any number:");
scanf("%d",&n);
f=n;
for(i=1; i<=n; i++)
{
f=f*i;
}
printf("Factorial is: %d",f);
getch();
}
----------------------------
OUTPUT
----------------------------
Enter any number: 5
Factorial is: 120
0 Comments