Program to Calculate Factorial

#include<stdio.h>
#include<conio.h>
void main()
{
int num,f=1,i;
clrscr();
printf("\nEnter No.");
scanf("%d",&num);
  for(i=1;i<=num;i++)
  {
   f=f*i;
  }
printf("\nFactorial is %d",f);
getch();
}

Leave a Reply