Question: Write a program that accepts an integer input from the keyboard and computes the sum of all the integers from 1 up to that integer.
Write a program that accepts an integer input from the keyboard and computes the sum of all the integers from 1 up to that integer. Example, if 7 were input, the sum: 1 + 2 + 3 + 4 + 5 + 6 + 7 would be computed. Use a while or for loop to perform the calculations. Print out the result after the sum has been calculated. NOTE: if you input a large integer, you will not get the correct results. C++ format, preferably codeblocks or in notepad
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
