Social Sciences, asked by ijarkhan007, 5 months ago

: Write a program to ask the user to input a number then Check Whether the input Number is Even or Odd .

Answers

Answered by Anonymous
1

import java.util.Scanner;

public class EvenOdd{

public static void main(String args[]){

Scanner sc=new Scanner(System.in);

System.out.println("Enter a number:");

int n=sc.nextInt();

if(n%2==0)

System.out.println("The number is even.");

else

System.out.println("The number is odd.");

}

}

Similar questions