lephuduc.90
Newbie level 5
Can anyone help me to write the code for the exercise below? I'm working with PCSpim.
The following is a sample of a program output given the inputs 1 - 5:
Enter an integer: 1
Enter an integer: 2
Enter an integer: 3
Enter an integer: 4
Enter an integer: 5
Enter an integer: 0
The number of entries = 5
The sum = 15
Write a program which uses a loop to accept an unspecified number of integer inputs, keep track of how many entries are made, and calculate a running sum of the entries. When a value of '0' is entered by the user, output the results and exit the program.
The following is a sample of a program output given the inputs 1 - 5:
Enter an integer: 1
Enter an integer: 2
Enter an integer: 3
Enter an integer: 4
Enter an integer: 5
Enter an integer: 0
The number of entries = 5
The sum = 15
Write a program which uses a loop to accept an unspecified number of integer inputs, keep track of how many entries are made, and calculate a running sum of the entries. When a value of '0' is entered by the user, output the results and exit the program.