Java - Is Even by mod operator

Description

Is Even by mod operator

Demo

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int n = 13;

        if(n % 2 == 0){
            System.out.print(true);
        }else{/*  ww  w  . j av  a2s.c  o  m*/
            System.out.print(false);
        }
    }
}

Related Topic