using while loop to add the numbers entered by user
Answers
Answered by
1
Answer:
In order to store the sum of the numbers, we declare a variable sum and initialize it to the value of 0 . The while loop continues until the user enters a negative number. During each iteration, the number entered by the user is added to the sum variable. When the user enters a negative number, the loop terminates.
Similar questions