Java While Loop Logic
What will val3 contain after the code segment is executed?
Consider the following code segment.
int val1 = 2, val2 = 22, val3 = 78;
while (val2 % val1 == 0 || val2 % 3 == 0)
{
val3++;
val2--;
}
What will val3 contain after the code segment is executed?
A
79
B
None of the above
C
77
D
80
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE