write a program to ask a user to input a number and print is the number is even or odd
Answers
Answered by
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
English,
5 hours ago
Social Sciences,
5 hours ago
Computer Science,
10 hours ago
English,
8 months ago
Science,
8 months ago
Math,
8 months ago