C Language (Factorial) While Loop

#include
#include

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

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

      }

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

}

Comments

Popular posts from this blog

NICOSIA