hii
in my computer am gettin crct o/p for the small factorial problem. if i run this in codechef, 1 st time i got runtime error. then i added return 0. again i uploaded and got it as wrong answer. can anyone help me to solve this??? this would be a great help. plz, ppl who knws guide me.
#include<stdio.h>
int main()
{
int test,i,j,fact;
printf("\n enter the no. of test cases");
scanf("%d",&test);
int a[100];
for(i=0;i<test;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<test;i++)
{
fact=1;
for(j=1;j<=a[i];j++)
{
fact=fact*j;
}
printf("%d",fact);
printf("\n");
}
return(0);
` `}