To check that the given number is EVEN or ODD
class EVENorODD
{
public void main(int n) //accepts an integer named n
{
if(n % 2 == 0)
System.out.println("You entered an even number.");
else
System.out.println("You entered an odd number.");
}
}
No comments:
Post a Comment