❔ Loop problem, beginner difficulty
Hi! I got stuck there and I'm run out of the ideas
Exercices:
Write a console application that calculates the sum of a given string of integers.
The numbers are entered one by one, and the application will read them one by one until the user writes the character x instead of a number. When the user has typed x the application knows that all the numbers in the string have been entered and displays their sum.
If the first thing the user types is the character x, the application will return 0.
Example:
For input data:
2
5
-3
1
x
The console will display:
5
Exercices:
Write a console application that calculates the sum of a given string of integers.
The numbers are entered one by one, and the application will read them one by one until the user writes the character x instead of a number. When the user has typed x the application knows that all the numbers in the string have been entered and displays their sum.
If the first thing the user types is the character x, the application will return 0.
Example:
For input data:
2
5
-3
1
x
The console will display:
5
