C++

Calculate Sum of Natural Numbers Beetwen 1 to N in C++1 min read

Positive integers 1, 2, 3, 4… are known as natural numbers.

This program takes a positive integer from user( suppose user entered n ) then, this program displays the value of 1+2+3+….+n.




C++ Code:

Output:

 

Leave a Comment