Logic to find whether number is Even or Odd
Oct 1, 2013
Make sure to subscribe to our newsletter and be the first to know the news.
Oct 1, 2013
Make sure to subscribe to our newsletter and be the first to know the news.
class EvenOdd
{
public static void main(String[] args)
{
int n=7;
if (n==0)
{
System.out.println("Number is 0");
}
else
{
if (n%2==0)
{
System.out.println("Number is Even");
}
else
{
System.out.println("Number is Odd");
}
}
}
}