C++ Program Sum of odd Natural Number

By: Prof. Fazal Rehman Shamil
Last modified on April 22nd, 2020

C++ Program Sum of odd Natural Number

Flowchart of Program of Sum of odd Natural Number

Flowchart of Program of Sum of odd Natural Number in C++

C++ Source code of  Sum of odd Natural Number

Excercise

Find the possible mistakes in the following Shamil’s Flow Table  of the programof Sum of odd Natural Numbers.

Loop

 

condition What line will execute What actual will do
I=1 True 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 plz Input number of terms : 3

The odd numbers are :   1

 

The Sum of odd Natural Number upto 3 are:1

I=2 True

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 13 14 15 16 18 19 20 21 22 23 24 plz Input number of terms : 3

The odd numbers are :   1  3

 

The Sum of odd Natural Number upto 3 are:4

I=3 True 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 13 14 15 16 18 19 13 14 15 16 18 19 20 21 22 23 24 plz Input number of terms : 3

The odd numbers are :   1  3 5

 

The Sum of odd Natural Number upto 3 are:9

I=4 false 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 22 23 24 plz Input number of terms : 3

The odd numbers are :   1  3  5

 

The Sum of odd Natural Number upto 3 are:9

 

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