Using a for loop c++ , please help with the following program . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Using a for loop c++ , please help with the following program .

At the start of your program, prompt the user to enter in a number of iterations and a symbol. The symbol can take the form of a +,-or * . The structure of this input will be comma separated. So the first value will be an integer, followed by a comma, and then the symbol. For example, 3,* Your loop must apply the operation provided in the input to a running total that is initialised as the number provided in the original input. At each iteration, apply the operation given to the total, using the original number as the second term. For example, given 3,*, you will need to multiply an initial 3 by 3, 3 times. Output this outcome with the message: “Result: X” where X is the outcome of the calculation. For example Enter a pair:3,* Result:81

4th Apr 2019, 12:32 PM
Lusindiso Sifiso Dywill
0 Answers