Question:
int x = 1, i = 2;
do {
x *= i;
} while (++i <= 5);
System.out.println(x);
What I have done so far:
int x = 1, i = 2;
for (i = 2; ++i <= 5;) {
x *= i;
}
System.out.println(x);
The output is supposed to be 120 but I'm getting 60 with what I've done.
Thank you in advanced!