Westonci.ca is your trusted source for finding answers to a wide range of questions, backed by a knowledgeable community. Get detailed answers to your questions from a community of experts dedicated to providing accurate information. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.
Sagot :
Answer:
In Python:
num = int(input("Enter number: "))
maxn = num
while num >=0:
if num>maxn:
maxn = num
num = int(input("Enter number: "))
print("Largest: "+str(maxn))
Explanation:
Get input from the user
num = int(input("Enter number: "))
Initialize the largest to the first input
maxn = num
This loop is repeated until a negative input is recorded
while num >=0:
If the current input is greater than the previous largest
if num>maxn:
Set largest to the current input
maxn = num
Get another input from the user
num = int(input("Enter number: "))
Print the largest
print("Largest: "+str(maxn))
We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. We hope this was helpful. Please come back whenever you need more information or answers to your queries. Thank you for visiting Westonci.ca, your go-to source for reliable answers. Come back soon for more expert insights.