Program to check whether the inputted number is even or odd JAVA


Write a Program to check whether the inputted number is even or odd.




import java.util.*;
class evenodd
{
    public static void main(String args[])
    {
         Scanner sc = new Scanner(System.in);
         int n = sc.nextInt();
         if(n%2==0)
     
         System.out.println("It is a even number");
         
         else
     
         System.out.println("It is a odd number");
         
    }
}



     
                     

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com