In python:
total = 0
while True:
num = int(input("Enter a number: "))
if num == 0:
break
total += num
print(f"The final sum is {total}")
5.2m questions
6.8m answers