Computer Science, asked by shafaquekhan1858, 1 day ago

write a program in java to input a number and check wether it is odd or even.​

Answers

Answered by pawanimalsavers
1

Answer:

import java.util.Scanner;

public class Odd_Even  

{

   public static void main(String[] args)  

   {

       int n;

       Scanner s = new Scanner(System.in);

       System.out.print("Enter the number you want to check:");

       n = s.nextInt();

       if(n % 2 == 0)

       {

           System.out.println("The given number "+n+" is Even ");

       }

       else

       {

           System.out.println("The given number "+n+" is Odd ");

}

   }

}

Similar questions