Classifying integers as 'Odd' or 'Even'

Report a typo

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.

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};
              
                }
              
___

Create a free account to access the full topic