Answer the question
In order to leave comments, you need to log in
How to find the sum of numbers in the range from 1 to n (n is entered by the user), step 1?
How to find the sum of numbers between 1 and n(user input), step 1, through a loop?
Entered for example 5, displays
1
2
3
4
5
How can I calculate the sum of digits from 1 to n (roughly speaking).
Answer the question
In order to leave comments, you need to log in
Get a counter (variable) and in a cycle from 1 to n add one to the counter.
Or use the formula for calculating the sum for an arithmetic progression.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question