code is as follows:
import java.util.Scanner;
public class Factorial {
public static void main(String[] args) {
System.out.println("------");
Scanner input = new Scanner(System.in);
int i ;
int j;
int sum = 1;
System.out.print(":");
i = input.nextInt();
j = i;
while (i >= 1) {
sum *= i;
i--;
}
System.out.println(j+":"+sum);
}
}
code test, enter 5rec 6jie 7je 8 all of these are all right
but enter 100jue 99 and so on to get the conclusion is 0
what"s going on here? As shown in figure