/*
 factorial
    */

#include <stdio.h>
int main()
{
 printf("input Number\n");
 int nInput=0;
 scanf("%d", &nInput);
 int nResult = nInput;
 if(nInput<=0)
  nInput=0;
 else if(nInput==1)
  nInput=1;
 else
  for(int i=nInput-1; i>1; i--)
   {
    nResult*=i;
   }
 
 printf("Result = %d\n", nResult);

 return 0;
}

+ Recent posts