Sir, this is my code for small factorial problem but I am not able to find out my mistake as it is giving my perfect output but codechef is not accepting it…?
#include<stdio.h>
main()
{
int t,fact=1,i,n;
scanf("%d",&t);
int a[t];
for(i=0;i<t;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<t;i++)
{
fact=1;
n=a[i];
while(n!=1)
{
fact=fact*n;
n=n-1;
}
printf("\n%d",fact);
}
}