package com.tutorial4u;
import java.util.Scanner;
public class OddorEven {
public static void main(String[] args) {
System.out.println("Enter an Integer to check if it is odd or even.");
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
if(num%2==0){
System.out.println("Entered number is even. ");
}else{
System.out.println("Entered number is odd. ");
}
}
}
Enter an
Integer to check if it is odd or even.
24
Entered
number is even.
No comments:
Post a Comment