I can not seem to find the error in my code. When I put numbers smaller or equal to 12 my program gives the right result, but from number 13 the values go out wrong and I can not know why. What is wrong?
class vdois {
static int fatorial (int numero){
int fat = 1;
while (numero >0) {
fat *= numero;
numero--;
}
return fat;
}
public static void main(String[] args) {
int numero = 13;
System.out.println(numero+"! = "+fatorial(numero));
}
}