WHAT'S NEW?

Logic to find whether number is Even or Odd

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");
}
}
}
}

0 comments:

Post a Comment