Write a program to find given number is ODD or Even
public class evenodd { public static void main(String[] args) { System.out.println("Enter the number"); Scanner sc=new Scanner(System.in); int num=sc.nextInt(); if(num/2==1) { System.out.println("Number is ODD"); else System.out.println("Number is EVEN"); } } Output: Enter the number 88 Number is EVEN
No comments:
Post a Comment