write a program in Java to inter any number and check whether it's even or odd
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class EvenOdd {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = reader.nextInt();
if(num % 2 == 0)
System.out.println(num + " is even");
else
System.out.println(num + " is odd");
}
}
Explanation:
please mark my answer brainlist
Similar questions
English,
3 months ago
Business Studies,
3 months ago
Social Sciences,
3 months ago
English,
7 months ago
Physics,
1 year ago