πŸ“Š JAVA
Q. Which of the following is the correct syntax for a while loop in Java?
  • (A) while (x < 10) { System.out.println(“Hello”); }
  • (B) do { System.out.println(“Hello”); } while (x < 10);
  • (C) for (int i = 0; i < 10; i++) { System.out.println(“Hello”); }
  • (D) while (x < 10) System.out.println(“Hello”);
πŸ’¬ Discuss
βœ… 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.

Explanation by: Deepak Sahoo
The while loop executes the block of code while the specified condition is true.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
184
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Deepak Sahoo
Publisher
πŸ“ˆ
82%
Success Rate