
How to find out whether a given input is a odd number or even number.

import java.util.*;
class CheckNumber
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.print("Enter Number: ");
int number=input.nextInt();
if(number%2==0){
System.out.println("Even Number!");
}
else{
System.out.println("Odd Number!");
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.