Sum

Report a typo

Write a program that calculates the sum of numbers from 1 to n, where n is a user-input positive integer, using a while loop.

Sample Input 1:

5

Sample Output 1:

15
Write a program in C++





Create a free account to access the full topic