Multiple choice technology programming languages

  1. int i =1,j =10; 12. do { 13. if(i++> --j) { 14. continue; 15. } 16. } while (i <5); 17. System.out.println(“i = “ +i+ “and j = “+j); What is the result?

  1. i = 6 and j = 5

  2. i = 5 and j = 6

  3. i = 5 and j = 5

  4. i = 6 and j = 6

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The do-while loop runs while i < 5. In each iteration, i increments (postfix) and j decrements (prefix). After 4 iterations, i becomes 5 (causing loop exit) and j becomes 6. The continue statement has no effect since it's at the end of the loop body.