C++ Program to Find Sum of Natural Numbers


Prev Tutorial Next Tutorial

Find Sum of Natural Numbers Program in C++

Natural Numbers are counting numbers, that is 1, 2, 3, 4, 5, 6, 7... etc. Remember, zero and negative numbers are not part of natural numbers. In this program, we will take a positive number N as input from user and find the sum of all natural numbers between 1 to N(including 1 and N).


Enter the number of integers to add: 5
1 2 3 4 5 
SUM = 15

To understand below example, you have must knowledge of following C++ programming topics; for looping statements we need know For Loop in C++ and Cout and Cin in C++.

C++ program to find sum of numbers between 1 to N


void main()
    int N=0, num, i, sum=0;
    cout<<"Enter the Number of Integers to Add: ";
    cin >> N;
    cout<<"Enter "<<N<<" Numbers: ";
    for(i= 0; i< N; i++){
        sum = sum + num;
    cout<<"Sum is: "<<sum;



Enter the Number of Integers to Add: 5
Enter 5 Numbers: 35
find sum of natural number in c++
Prev Tutorial Next Tutorial


Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements

Buy Websites 9999595223
wifi cctv camera

Wifi CCTV Camera RS:1200 to 2499. Contact no. 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs