Q. Which of the following is the correct syntax for a while loop in Java?
β
Correct Answer: (A)
while (x < 10) { System.out.println(“Hello”); }
Explanation: The while loop executes the block of code while the specified condition is true.