Saturday, 22 September 2012

Even Or Odd Number

/* Java Program To Check Whether Number is Even or Odd */

class Even
{
public static void main(String args[])
{
int a = 2;
if((a % 2) == 0)
System.out.print("Number is even");
else
System.out.println("Number is odd");

}
}

/************** OUTPUT **************

Number is even */

0 comments:

Post a Comment