IDNLearn.com: Where your questions are met with thoughtful and precise answers. Get the information you need from our community of experts who provide accurate and thorough answers to all your questions.
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 value your presence here. Keep sharing knowledge and helping others find the answers they need. This community is the perfect place to learn together. IDNLearn.com is your go-to source for accurate answers. Thanks for stopping by, and come back for more helpful information.