#4 | Prompt the user to add numbers until a negative number.

Опубликовано: 14 Май 2026
на канале: Journey in Programming
212
2

This program prompts the user to input a number in an infinite amount of times (in theory, because I really can't prove that myself) and only stops when the user inputs a negative number.

Input:
Enter a number: 1
Enter a number: 1
Enter a number: -1

Output:
The sum is: 1

NOTE: I advise everyone that you SHOULD NOT use this video as a guide for your programming career as I myself is just a student, I lack the experience and expertise to teach and I just want to make that clear to all of you. Thank you.