Given an array of integers, your task is to classify every number as 'Odd' or 'Even'. If a number is divisible by 2, it's 'Even'. Otherwise, it's 'Odd'. Your program should print 'Even' or 'Odd' correspondingly for each element in the array. Please reorder the given lines of code to create a working Java application that accomplishes this task.
Iterating over arrays
Classifying integers as 'Odd' or 'Even'
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
}
public static void main(String[] args) {
}
for (int number : numbers) {
System.out.println("Even");
System.out.println("Odd");
} else {
public class Main {
}
if (number % 2 == 0) {
int[] numbers = {1, 2, 3, 4, 5};
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.