Odd or even program in java using a mod operator

Write a program to print Odd or Even in java using mod operator. For beginners, odd or even in the java programming language. This is a simple collection of Java programmes for beginners to check the number

import java.util.Scanner;
public class Main
public static void main(String[] args)
Scanner reader = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = reader.nextInt();
if(num % 2 == 0)
System.out.println(num + " is even");
System.out.println(num + " is odd");


2020 is evenĀ