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