Computer Science, asked by rudrapawar2007, 2 months ago

using while loop to add the numbers entered by user

Answers

Answered by digantha2
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