/*Write a java code that uses a class to accept an array of n elements and find the number of even and odd numbers. AIM:To find the number of even and odd elements from a array containing 'n' elements*/ import java.io.*; class arrayman { public static void main(String args[])throws IOException { DataInputStream in=new DataInputStream(System.in); int a[]=new int[10]; int even=0,odd=0; System.out.println("ENter the array elements"); for(int i=0;i<10;i++) { a[i]=Integer.parseInt(in.readLine()); if(a[i]%2==0) even=even+1; else odd=odd+1; } System.out.println("No.Of even elements= "+even); System.out.println("No.of odd elements= "+odd); } }