CJCoding With Joseph
15per day
← Back to Question List
Java Code Walkthrough #8

While Loop with Condition

easyLoops

📄 Code

Read carefully — what does this print?
1public class Main {
2 public static void main(String[] args) {
3 int x = 10;
4 while (x > 1) {
5 x = x / 2;
6 }
7 System.out.println(x);
8 }
9}

🎯 Your Answer