Determining even or odd numbers in an array

Report a typo

You have been given an array of integer values. Your task is to fill the blanks in code to iterate over this array, determine whether each number is odd or even, and print a message that states 'The number [number] is [odd/even].' Note that the array length might change so your solution should be dynamic. You need to use a loop, a condition and certain predefined array properties.

Fill in the gaps with the relevant elements
public class Main{
    public static void main(String[] args){
        int[] numbers = {5, 10, 15, 20, 25};
        (int i = 0; i < numbers.; i++){
            (numbers[i] % 2 == 0){
                System.out.println("The number " + numbers[i] + " is even.");
            } else{
                System.out.println("The number " + numbers[i] + " is odd.");
            }
        }
    }
}
lengthiffor
___

Create a free account to access the full topic