How many times are the following loop bodies repeated? What is the output of each loop?
(a)
int i = 1;
while (i<10)
if (i % 2 == 0)
System.out.println(i);
(b)
int i = 1;
while (i<10)
if (i % 2 == 0)
System.out.println(i++);
(c)
int i = 1;
while (i<10)
if ((i++) % 2 == 0)
System.out.println(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.