public static void main(String[] args) { int num = 12; if (num % 2 == 0) { // even number } else { // odd number } }