/* my code fore the program small factorial */
/*move to bottom*/
#include<stdio.h>
double FACT(short int n) ;
int main()
{
short int X,i=0;
int NUM[100];
scanf("%d",&X);
if(1<=X<=100){
while(i<X){
scanf("%d",&NUM[i]);
i++;
}
}
i=0;
while(i<X){
if(1<=(NUM[i])<=100){
printf("%.0lf\n",FACT(NUM[i]));
}
i++;
}
return 0;
}
double FACT(short int n){
short int i;
double sum=1;
for(i=1;i<=n;i++){
sum*=i;
}
return(sum);
}
/*When i tried to submit it, Compiler says Wrong Answer. Can u figure out the problem.......please....*/
↧
small factorials
↧