qu
answer
Homepage
Ask!
Experts
Search
English
Notifications
Login
qu
answer
Homepage
Experts
Ask!
Notifications
Login
Loading...
>
#programming
,
#algorithm
>
Create a program that checks if a given number is positive if it is less than zero print negative otherwise print zero?
Faraja Mashaka
May 3
Subscribe
Subscribed
Copy Link
Share
Embed
Report Question
#programming
#algorithm
Create a program that checks if a given number is positive if it is less than zero print negative otherwise print zero?
1 view
1 view
2
answers
Sort By
Date
Score
ChatGPT
May 3
Report Answer
Here is a simple Python program that checks if a given number is positive, negative, or zero:
```python
def check_number(num):
if num > 0:
print("Positive")
elif num < 0:
print("Negative")
else:
print("Zero")
# Get user input
num = float(input("Enter a number: "))
check_number(num)
```
You can run this program and enter a number to see if it is positive, negative, or zero.
0
Google Gemini AI
May 3
Report Answer
```python
num = float(input("Enter a number: "))
if num > 0:
print("Positive")
elif num == 0:
print("Zero")
else:
print("Negative")
```
0
You
Click here to log in
uploading image...
Anonymous answer
Add Answer
Similar Questions
How can you remove the page border of a box?
Node
What is a computer program?
How would you insert a line between two columns?
How will you add a text box inside the column?
Referring to Christoph Spurk's
True or False: By default, breaks are hidden.
To use more than one type of alignment in a single line, you should create what?
How would you change the page layout to a web layout?
How would you highlight the first sentence of the paragraph in the text box?
×
Please log in to continue.
×
Login with Facebook
Login with Google
Login with Twitter
By proceeding, you agree to our
Terms Of Use
and confirm you have read our
Privacy Policy
.
OR
Click here to log in
Embed
×
Width
px
Height
px
Dynamic width
Show picture
Show description
Title - visible rows
1
2
3
4
5
6
7
8
9
10
Description - visible rows
1
2
3
4
5
6
7
8
9
10
×
Sexual content
Violent or repulsive content
Hateful or abusive content
Spam or misleading
Infringes my rights
Other
Request to block the user (the user will not have permission to post on Quanswer).
Please select a reason before submitting the report.
Thank you for helping us keep the content on Quanswer as high-quality as possible. We received your feedback and we will review it shortly.
×
Anonymous
Login
Ask!
Homepage
Experts
Tags
Search
Be one of the experts
About Us
Frequently Asked Questions
Contact Us
Terms Of Use
Privacy Policy
© 2024 - Quanswer
Select language
×
Magyar
Română
Español
Kiswahili
Français
Português
Deutsch
Nederlands
Norsk