Find factorial :-
int factorial = number;
for (int i = number - 1; i > 0; i--) {
factorial = factorial * i;
}
System.out.println(factorial);
Find factorial :-
int factorial = number;
for (int i = number - 1; i > 0; i--) {
factorial = factorial * i;
}
System.out.println(factorial);