write an algorithm to check whether a number is positive or negative
Answers
Answered by
2
def check_num(n):
if n == 0:
return "0"
if n > 0:
return "positive"
return "negative"
n = int(input("enter num: "))
print(check_num(n))
Similar questions
Math,
2 months ago
Math,
2 months ago
English,
5 months ago
Social Sciences,
11 months ago
Math,
11 months ago
Accountancy,
11 months ago