Program to Calculate Factorial using “DO-WHILE” loop.

#include<stdio.h>
#include<conio.h>
void main()
{
   int i=1,num,f=1;
   clrscr();
      printf("\nENTER NUMBER=>");
      scanf("\n %d",&num);
       while(i<=num)
      {
  f=f*i;
  i++;
      }
     printf("\n factorial is=>%d",f);
     getch();


getch();
}

Leave a Reply