Java program -4: Write a java program which check Even or Odd number.

in #java7 years ago

Solution:

import java.util.Scanner;

public class Check{

public static void main ( String [] args) {

int number ;
Scanner input = new Scanner(System.in);

System.out.print(" Enter e Integer Number :__);
number = input.nextInt();

if(number%2==0){
System.out.println("Entered number is Even");
}
else {
System.out.println(" Entered number is Odd ");
}
}
}

Input : 5

output : Entered number is Odd

14040147_1637272369898191_6102737841471581276_n.png