Iterative Program Structure: (using basic loop)
Create a flowchart, simulation, pseudocode and C++ Program that will generate the following number series:
1,2,4,7,11,16,22,29,37, and 46
PSEUDO CODE:
DECLARE COUNT=1,I=1
LOOP: I<=46
PRINT I
I=I+COUNT
COUNT=COUNT+1
END LOOP
C++ Code:
#include<iostream>
using namespace std;
int main(){
int count=1;
//iterating the loop and increasing the I by count everytime
for(int i=1;i<=46;i+=count,count++)
cout<<i<<" ";
}
//Simulation
Flow Chart:
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me
Get Answers For Free
Most questions answered within 1 hours.