Showing posts with label Even or Odd. Show all posts
Showing posts with label Even or Odd. Show all posts

Thursday, July 7, 2011

Program to check whether number is Even or Odd

class EvenOdd
{
public static void main(String args[])
{
int no , temp ;
no = 35;

temp = no % 2 ;
if (temp == 0)
System.out.println("The number "+no+" is Even");
else
System.out.println("The number "+no+" is Odd");
}
}