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.
Enter your a no.
0 K comment
Post a Comment