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

Coin Marketplace

STEEM 0.25
TRX 0.20
JST 0.038
BTC 93576.77
ETH 3422.25
USDT 1.00
SBD 3.78