Viser opslag med etiketten text editor. Vis alle opslag
Viser opslag med etiketten text editor. Vis alle opslag

søndag den 26. maj 2019

C++ using for loop to sum the numbers from 50 to 100

This exercise is from the C++ primer 4th edition book from 2005. The program works and runs fine. This is a solution to the exersice section 1.4.2 on page 17.

Exercise 1.10: Write a program that uses for loop to sum the numbers from 50 to 100. Now rewrite the program using a while loop.
💥 Beware: This is not just a simple program that adds two numbers together. It is a little bit more complicated than that.