package com.tutorial4u;
import java.util.Scanner;
/*Java
Program to Find odd or even Numbers in an Array*/
public class EvenOrOddInArray {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the size of Array : ");
int num = sc.nextInt();
int arr[] = new int[num];
System.out.println("Enter all the element : ");
for(int i=0;i<num;i++){
arr[i]=sc.nextInt();
}
for (int i = 0; i <num; i++) {
if (arr[i] % 2 ==
0)
System.out.println("even");
else
System.out.println("odd");
}
}
}
Enter
the size of Array : 5
Enter
all the element :
22
21
33
42
24
even
odd
odd
even
even