Asked by suraj

how to print 2,5,11,20,32 to 200 and print its sum

Answers

Answered by MathMate
0. Set current sum as 0.
1. Set the current value as 2.
2. Set the current difference as 0.
3. Add current difference to current value.
4. Add current value to sum.
5. Print current value.
6. Increase current difference by 3.
7. As long as the current value does not exceed 200, repeat from step 3.

Translate this to qbasic code.

Related Questions