Javatpoint Logo
Javatpoint Logo

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


Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA