Program to check whether the given number is positive or negative

Program to check whether the given number is positive or negative

public class Demo
{
    public static void main(String[] args) 
    {
        int number=109;
        if(number > 0)
        {
            System.out.println(number+" is a positive number");
        }
        else if(number < 0)
        {
            System.out.println(number+" is a negative number");
        }
        else
        {
            System.out.println(number+" is neither positive nor negative");
        }
    }
}

Share this

Related Posts

Previous
Next Post »

Recent