Java

Program to check whether a number is even or odd.

Program to check whether a number is even or odd.
import java.util.*;
import java.lang.*;
import java.io.*;

public class EvenOdd {

    public static void main(String[] args) {
        int num=23;

        if(num % 2 == 0)
            System.out.println(num + " is even");
        else
            System.out.println(num + " is odd");
    }
}
Nikhil Juneja

Passionate software developer and technical contributor at TutorialsLink.