Programming Exercises

1:Write a program that requests the user to enter two integers. The program then should calculate and report the sum of all the integers between and including the two integers. At this point, assume that the smaller integer is entered first. For example, if the user enters 2 and 9, the program reports that the sum of all the integers from 2 through 9 is 44.
2:Write a program that asks you to type in numbers. After each entry, the number reports the cumulative sum of the entries to date. The program terminates when you enter a zero.
3:Daphne invests $100 at 10% simple interest. That is, every year, the investment earns 10% of the original investment, or $10 each and every year:

interest = 0.10 x original balance

At the same ...

Get The Waite Group's C++ Primer Plus, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.