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}")
7.8m questions
10.4m answers