Step by step learning
What will be the output of the program?
class MyProgram { public static void main(String[] args) { int i = 1, j = 10; do { if (i > j) { break; } j--; } while (++i < 5); System.out.println("i = " + i + " and j = " + j); } }
i = 5 and j = 6
i = 6 and j = 4
i = 5 and j = 5
i = 6 and j = 5
Please log in or register to have a possibility to add comment.
Please log in or register to have a possibility to add comment.