Q:

write python program to Find the largest number in a set of positive numbers entered by user and ending with 0

0

using while loop,

Find the largest number in a set of positive numbers entered by user and ending with 0.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

max = 0
while True:
    n = int(input("Enter an integer: "))
    if n == 0:
     break
    if n > max:
     max = n
print("Largest number is: ", max)

need an explanation for this answer? contact us directly to get an explanation for this answer
need an explanation for this answer? contact us directly to get an explanation for this answer

max = 0
while True:
    n = int(input("Enter an integer: "))
    if n == 0:
     break
    if n > max:
     max = n
print("Largest number is: ", max)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (2)

Similar questions


need a help?


find thousands of online teachers now