Type Here to Get Search Results !

Program to check whether the given number is positive or negative

0

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

Post a Comment

0 Comments

Recent-post