Computer Science, asked by lalitadevirmg1234, 27 days ago

Write a program in Java to input a number and find the number is even or odd.​

Answers

Answered by mishika62
1

Explanation:

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 ");

}

}

}

Plz mark me as brainliest

Similar questions