Write a program that will calculate the sum of the first n odd integers using a Do/While loop/For loopC++ Programming

Write a program that will calculate the sum of the first n odd integers

- Use a Do/While loop

- Use a For loop

Use an array to store the odd integers which calculates and returns the total at the end.  Use additional arrays if needed.

Here is a sample of program being run:

How many integers would you like to add?  5

Count     Odd Integer     Sum

   1                 1                  1

   2                 3                  4

   3                 5                  9

   4                 7                  16

   5                 9                  25

The sum of the first 5 odd integers is 25.

Do you want to add again?  Press y or n

C++ Programming Experts

expert
Dinh Hong P.
C++ Programming

20 Answers

expert
Eric Bell
C++ Programming

88 Answers

View More Experts
Disclaimer

The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.

Get Free Quote!

256 Experts Online