EVEN OR ODD CHECK USING JAVA

import java.util.Scanner;
public class evenjavaoddcheck
    public static void main(String []args){

        Scanner sc = new Scanner(System.in);
        System.out.println("enter the number");
        int a = sc.nextInt();
        if (a % 2 == 0) {
            System.out.println("this odd number");

        } else {
            System.out.println("this number is even");
        }
    }
    
}
public class even1 {
    public static void main(String []args){
        int n = 6;
        if(n%2==0)
            System.out.println("even");
   else
    
            System.out.println("odd");
        }
    }

Add a Comment

Your email address will not be published. Required fields are marked *