Java Program To Check Whether A Number Is Positive or Negative
Java Program To Check Whether A Number Is Positive or Negative
else
Output
If you change the value of number to a negative number (say -12.3), the output will be:
In the above program, it is quite clear how the variable number is checked to be positive or
negative, by comparing it to 0.