4.1. Sum of Numbers - Java

in programming •  8 years ago 

Starting out with Java: From control structures through objects

Chapter 4

Programming Challenges

1. Sum of numbers 

Write a program that asks the user for a positive nonzero integer value. The program should use a loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1, 2, 3, 4, . . . 50.

Gaddis, Tony (2015-05-29). Starting Out with Java: From Control Structures through Objects (Page 262). Pearson Education.

Kindle Edition.

Happy Steeming Everyone! :)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!