Kat H.

asked • 04/19/21

Counting 2. Read in three numbers. A start value, an increment value, and an end value (all integers). Start counting from the start, adding the increment at each step...

Read in three numbers. A start value, an increment value, and an end value (all integers). Start counting from the start, adding the increment at each step, until you are at or above the end value.


Input of 4 3 12 means start from 4, count by 3's until you hit (or go past) 12. Your program should output: 471013 (4 7 10 13 without any spaces).


Hint: this problem is MUCH easier to do if you think of the last value (or first) as a special case that happens after the loop


Code:


#include <iostream>

using namespace std;


int main()

{

//YOUR_CODE

}

1 Expert Answer

By:

Patrick B. answered • 04/20/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.