Welcome to Westonci.ca, your go-to destination for finding answers to all your questions. Join our expert community today! Connect with a community of experts ready to provide precise solutions to your questions on our user-friendly Q&A platform. Get precise and detailed answers to your questions from a knowledgeable community of experts on our 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 hope you found what you were looking for. Feel free to revisit us for more answers and updated information. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. We're here to help at Westonci.ca. Keep visiting for the best answers to your questions.