C++ Program to Check Whether a Number is Even or Odd

One comment on “C++ Program to Check Whether a Number is Even or Odd”


  • Md

    import java.util.*;
    import java.io.*;
    import java.lang.*;
    public class Main
    {

    public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int num=sc.nextInt();
    if(num%2==0){
    System.out.println(“EVEN”);
    }
    else{
    System.out.println(“odd”);
    }
    }
    }