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

While Loop with Condition

Java code walkthrough · Question 8
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