Sum of the first 10 natural numbers program in C++.

By: Prof. Fazal Rehman Shamil
Last modified on February 24th, 2021

Program in C++ to show the Sum of the first 10 natural numbers program in C++.

Flowchart of Sum of the first 10 natural numbers program by do-while loop

Flowchart of Sum of the first 10 natural numbers program in C++

Let us see the Flowchart of Sum of the first 10 natural numbers program.

C++ program of Sum of the first 10 natural numbers by using do-while loop

Let us see the C++ program of Sum of the first 10 natural numbers.

Output

12345678910 The sum of the first 10 natural numbers is? 55

Dry Run Explanation with SMT(Shamil’s Memory Table)

C++ program to find sum of n numbers using do while loop
C++ program to find sum of n numbers using do while loop
c++ program to calculate sum of 100 numbers
c++ program to calculate sum of 100 numbers
write a program in c++ to find the sum of first 20 or 1000 natural numbers
write a program in c++ to find the sum of first 20 or 1000 natural numbers

Flowchart of Sum of the first 10 natural numbers program by a while loop

C++ program to find the Sum of the 1st ten natural numbers with the help of  while loop

C++ program to find the Sum of the 1st ten natural numbers with the help of  while loop

Let us see the C++ program to find the Sum of the 1st ten natural numbers with the help of a while loop.

Output

The first 10 natural number are:

1 2 3 4 5 6 7 8 9 10

The sum is: 55

Declarations Flow table (DFT) of Sum of the first 10 natural numbers program in C++.

Let us see the DFT of the above program.

Variable Declaration

(Line Number)

Initialization

(Line Number)

Use

(Line Number)

sum 5 5,10 14
j 5 7,12 11

 

Sum first 100 Odd natural numbers

Write a program in c++ to find the sum of the first 100 odd natural numbers.

Sum first 1000 even natural numbers

Write a program in c++ to find the sum of the first 1000 even natural numbers.

Prof. Fazal Rehman Shamil
Latest posts by Prof. Fazal Rehman Shamil (see all)