Computer Science, asked by soni72641, 10 hours ago

write a program to ask a user to input a number and print is the number is even or odd

Answers

Answered by shreya426012
0

import java.util.*;

class numbers

{

public static void main [string args]

{

Scanner sc= new scanner ( System.in);

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

int a = newInt();

if( a%2==0)

{

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

}

else

{

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

}

}

}

I am new to this topic sorry if I am wrong

Similar questions