Positive number
All the numbers greater than 0, but not equal to 0 are positive numbers.
Negative number
Similarly all the number less than 0, but not equal to 0 are negative numbers.
Logic
If the number is greater than zero that means it is positive. If the number is less than zero that means it is negative. If the number is equal to zero that means it is absolute zero.
- if number > 0 then print Positive.
- if number < 0 then print Negative.
- if number == 0 then print Zero.
Program
# Take one integer number from user number = int(input("Enter any number : ")) # Number is greater than 0 if number > 0 : print("\nPOSITIVE NUMBER.") # Number is less than 0 if number < 0 : print("\nNEGATIVE NUMBER.") # Number is equals to 0 if number == 0 : print("\nNUMBER IS ZERO.")
Output
Enter any number : 101
POSITIVE NUMBER.