Program in C to find the factorial of the number (1x2x3x4)

Write a program in C to find the factorial of the number (1x2x3x4)

#include <stdio.h>
#include <conio.h>

void main ()
{
          int fact=1,no;
          clrscr();
          printf ("Enter any number: ");
          scanf ("%d",&no);
          do
          {
                   fact=fact*no;
                   no--;
          }
          while (no>0);
                   printf ("\nFactorial is %d",fact);
          getch ();
}


Post a Comment