The java code for the problem small factorial is giving correct output, but the code chef online judge is resulting wrong answer.
The code is given below. Please help me with this. Thanks.
import java.util.Scanner;
public class Main{
public static void main(String []args)
{
Scanner in=new Scanner(System.in);
int t=in.nextInt();
for(int i=0;i<t;i++)
{
int x=in.nextInt();
int f=1;
while(x>0)
{
f=f*x;
x–;
}
System.out.println(f);
}
}
}