Even Odd

Java Programming

Java Programming Examples

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