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.
While loop statement
Sum
Report a typo
Sample Input 1:
5Sample Output 1:
15Write a program in C++
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.