C++20 sections · 1024 units
Open in Course

Challenge: Sum of Numbers

Loop with accumulator

Loops are great for accumulating values! Your task: Read an integer N and calculate the sum of all numbers from 1 to N. Print the result.