Question: [Key goal: Understanding keyboard/screen I/O, input loops, and for/'while loops.] Arithmetic Progressions Write a C++ program which prompts the keyboard user to enter three integers
[Key goal: Understanding keyboard/screen I/O, input loops, and "for/'while" loops.] Arithmetic Progressions Write a C++ program which prompts the keyboard user to enter three integers (let's call them a, d, and n) and which outputs the first n terms of the arithmetic progression starting at a and with common difference d. Some examples follow a-5,d-3,n;#7: then the output should be 5 8 11 14 17 20 23 a-10, d2, n-8: then the output should be 10 8 6 4 20-2-4 a-11, d-0, n-3. then the output should be 11 11 11 a 7, d-9, n-1: then the output should be 7 (You can assume ns-0. Write each sequence all on one line, with spaces separating the numbers.) Also, write an input loop which allows the program to loop back and again prompts the user to enter another three numbers, reads them, and produces another arithmetic progression Let's agree that if the user enters n-0, (that is, enters three numbers with the third number being 0 this will signal end of input ] See if you can get the above ourput for the given inputs above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
