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

While Loop Countdown

Java code walkthrough · Question 15
easyLoops

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 int n = 5;
4 while (n >= 1) {
5 System.out.print(n + " ");
6 n -= 2;
7 }
8 }
9}

Your answer