What output is produced by the following code fragment? int num = 1, max = 20; while

Question:

What output is produced by the following code fragment?

int num = 1, max = 20;
while (num < max)
{
if (num%2 == 0)
System.out.println(num);
num++;
}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Software Solutions

ISBN: 9789353063610

9th Edition

Authors: John Lewis, William Loftus

Question Posted: