WHAT'S NEW?

Logic to find whether number is Negative or Positive


class PositiveNegative
{
public static void main(String[] args)
{
int n=10;
if (n<0)
{
System.out.println("Number is negative");
}
else
{
System.out.println("Number is positive");
}
}
}

0 comments:

Post a comment