Home » Java Program to print Odd and Even numbers from an Array

Java Program to print Odd and Even numbers from an Array

by Online Tutorials Library

Java Program to print Odd and Even Numbers from an Array

We can print odd and even numbers from an array in java by getting remainder of each element and checking if it is divided by 2 or not. If it is divided by 2, it is even number otherwise it is odd number.

Test it Now

Output:

Odd Numbers: 1 5 3 Even Numbers: 2 6 2 

Next TopicJava Programs

You may also like