What is the keyword break for? What is the keyword continue for? Will the following programs terminate? If so, give the output.
(a)
int balance = 10;
while (true) {
if (balance<9)
break;
balance = balance - 9;
}
System.out.println("Balance is "
+ balance);
(b)
int balance = 10;
while (true) {
if (balance<9)
continue;
balance = balance - 9;
}
System.out.println("Balance is "
+ balance);
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.