How to Find Odd or Even Numbers using Java Swing

This tutorial will teach you How to Find Odd or Even Numbers using Java Swing.

java project

Paste the Code Inside the Ok Button

int num = Integer.parseInt(txtnum.getText());

if(num % 2 == 0)
{
    JOptionPane.showMessageDialog(this, num + " : is Even ");
}
else
{
    JOptionPane.showMessageDialog(this, num + " : is Odd ");

}

i have attached the video link below. which will do this tutorials step by step.

 

 

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

thirteen − two =