Sat Sep 04 2021

Even Odd

File Name: even-odd.java

import java.io.*;

class even_odd {
	public static void main(String args[ ]) {
		int no;
		no = Integer.parseInt(args[0]);

		/* Check the modulus of 'no' is zero or not */
		if (no % 2 == 0)
			System.out.println("It's a Even Number");
		else
			System.out.println("It's a Odd Number");
	}
}



/* Output */
java even_odd 4
It's a Even Number

/* ------------------------- */

java even_odd 5
It's a Odd Number

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.