SMALL FACTORIAL ,wrong answer.someone please find out the error.

#include<stdio.h>
int fact(int n);
int fact(int n)
{
int f=1,i=1;
for(i=1; i<=n; i++)
{
f=f*i;
}
return f;
}

int main()
{
int f,n,x,i;
scanf("%d",&x);
if(x>=1&&x<=100)
{
for(i=0; i<x; i++)
{
scanf("%d",&n);
if(n>=1&&n<=100)
{
f=fact(n);
printf("%d\n",f);
}

    }
}
return 0;

}

Factorial of 100 is 158 digits long , so you cannot store its value in integer(int or long) , you have to use different datatypes such as string to store this kind of values.
This will help .