write a program to check whether the number is even number or not using if statement. For input use scanner method
Answers
Answered by
1
Answer:
// Mark as Brainliest
import java.util.Scanner;
// Main Class
class EvenCheck{
// Main Method
public static void main(String[] args) {
// Scanner object
Scanner scan = new Scanner(System.in);
// Read input as integer
int num = scan.nextInt();
// Condition
if (num%2 == 0){
System.out.print(num+" is even");
}
else{
System.out.print(num+" is not even") ;
}
}
}
Similar questions