CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

For Loop Factorial

Java code walkthrough · Question 22
mediumLoops

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 int product = 1;
4 for (int i = 1; i <= 5; i++) {
5 product *= i;
6 }
7 System.out.println(product);
8 }
9}

Your answer