Menu
Question Index
...

Write a program to find that given number is negative or not

Input (Number) Output
-12.0 true
-0.023 true
12.0 false
0.0 false
null false



class NegativeNumber
{
    public static void main(String s[])
    {
        Double number = -12.45;
        System.out.println("The given number "+number+" is negative number "+isNegativeNumber(number));

    }


        public static boolean isNegativeNumber(Double number)
        {
            boolean result = false;
            return result;
        }

}

Doubts

Problems

Topic: Java Double Class And Java Float Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App