Write a python program to test whether a number entered by the user is negative, positive or equal to zero.

                               Write a python program to determine whether a person is eligible to vote.

Write a python program to test whether a number entered by the user is negative, positive or equal to zero.


PROGRAM:

num=int(input("Enter a number:"))
if (num<0):
    print(num, " is a negative.")
elif (num>0):
    print(num, "is a positive.")
else:
    print(num, "is equal to zero.")

OUTPUT:

No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.