Jak znaleźć czynnik w Javie
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num = input.nextInt();
int fact = 1;
for (int i = num; i > 0; i--) {
fact *= i;
}
System.out.println("factorial: "+fact);
}
Chathumal Sangeeth