Question: explain WHY the answer is the way it is, DONT *only* type the answer, I need to know HOW you got it PLEASE! 6.3.6 Print

 explain WHY the answer is the way it is, DONT *only* type the answer, I need to know HOW you got it PLEASE!


6.3.6 Print Odds Submit + Continue Save Output Test Cases Docs Assignment

6.3.6 Print Odds Submit + Continue Save Output Test Cases Docs Assignment Grade More 1 public class PrintOdds 2- 5 points Status: Not Submitted 3 public static void main(String[] args) 4- { 5 int[] values = {17, 34, 56, 2, 19, 100}; In this exercise, rewrite the for loop in the starter code, which prints out the odd numbers in an array, as an enhanced for-each loop. 6 7 8 - { 9 for (int i = 0; i < values.length; i++) if (values[i] % 2 1) 10 11 } 12 } 13} System.out.println(values [i] + is odd"); "

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To rewrite the for loop in the starter code as an enhanced foreach loop we need to understand the st... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!