/my code for small factorial progtam/
#include<stdio.h>
double FACT(int n) ;
int main()
{
int X,i=0;
int NUM[100];
scanf("%d",&X);
if((1<=X)&&(X<=100)){
while(i<X){
scanf("%d",&NUM[i]);
i++;
}
}
else return 0;
i=0;
while(i<X){
if((1<=NUM[i])&&(NUM[i]<=100)){
printf("%.0lf\n",FACT(NUM[i]));
}
else return 0;
i++;
}
return 0;
}
double FACT(int n){
int i;
double sum=1;
for(i=1;i<=n;i++){
sum*=i;
}
return(sum);
}
/* i tried many times but every time it says WRONG ANSWER. What's the problem in this code now, Please help */