Even and Odd Number in Java,Even odd java

  

CODE


import java.util.*;
class evenodd{
	public static void main(String[] args) {
		Scanner s1= new Scanner(System.in);
		System.out.println("Enter your a no.");
		double a=s1.nextDouble();
		  
		if(a%2==0)
	 
		System.out.println("It is a even no.");


		 
		else
			System.out.println("It is a odd no.");
	}
}

Output:--

Enter your a no.

5

It is a odd no.


0 K comment

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel