Computer Science, asked by RosyX, 1 year ago

Write a program in Java to display whether a given number is even or odd. Please enter the value in the beginning. Please help me, tomorrow is my exam.

Answers

Answered by siddhartharao77
4
public class Beginning
{

public static void main(String [] args)
{

int a;

Scanner Demo = new Scanner(System.in);

System.out.println("Enter Number :");

a = Demo.nextInt();

if(a % 2 == 0)
{
println("The Number is even");
else
println("The Number is Odd");
}
}


Hope this helps! :)

RosyX: Tumne kiya
siddhartharao77: Could you please chat privately. Because I am getting notifications
RosyX: Sorry
RosyX: But can u plz make him understand
RosyX: How to unblock
Pawan251: hiii
Pawan251: i am Pawan
Anonymous: Hey tum ne block kiyu kiya??
Anonymous: Rosyx
Anonymous: what happened? ?
Similar questions