write a program to check whether a given number is positive or negative.if positive then ,find whether even or odd
Answers
Answer:
hello,
its using python
Explanation:
#program to check whether a given number is positive or negative.if positive then ,find whether even or odd
n=int(input("enter the number"))
if n<0:
print(n,"is a negative number")
elif n==0:
print(n,"is zero")
else:
print(n,"is a positive number")
if n%2==0:
print(n,"is an even number")
else:
print(n,"is an odd number")
______________________________
hope it helps you
please mark brainliest
@ItzSnowySecret07
Python Code:
number = int(input(’Enter the number - ’))
positive = False
even = False
if number >= 0:
positive = True
if number % 2 == 0:
even = True
if posiitive:
if even:
print(f’{number} is Positive and Even’)
else:
print(f’{number} is Positive and Odd‘)
else:
if even:
print(f’{number} is Negative and Even’)
else:
print(f’{number} is Negative and Odd.’)