Rewrite the C program segment of Programming Exercise in Java without using a switch construct
Exercise
Consider the following C program segment. Rewrite it using no gotos or
breaks.
j = -3;
for (i = 0; i < 3; {
switch (j + 2) {
case 3:
case 2: j—; break;
case 0: j += 2; break;
default: j = 0;
}
if (j > 0) break;
j = 3 - i
}
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.