C Language (Factorial) Do while loop

#include
#include

void main()
{
 clrscr();
 long a,b;
 printf("Enter value");
 scanf("%ld",&a);

 b=a;
 printf("\n %ld",b);

 do
   {
 a--;
 printf(" * %ld" ,a);
 b=b*a;
      }
  while (a>1);

  printf(" = %ld",b);
  getch();

}

Comments

Popular posts from this blog

NICOSIA