Suppose that you are trying to write a program that produces the following output: 1 3 5

Question:

Suppose that you are trying to write a program that produces the following output:

1 3 5 7 9 11 13 15 17 19 21
1 3 5 7 9 11

The following program is an attempt at a solution, but it contains four major errors. Identify them all.

1. public class BadNews { public static final int MAX_ODD = 21; public static void writeOdds () { 4. // print each odd number for (int count = 1; count

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

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: