Sat Sep 04 2021
Even Odd
Java Programming874 views
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
Author:Geekboots