JAVA for Windows XP
the question is:
Write an application that shows the sum of 1 to n for every n from 1 to 50. That is, the program prints 1 (the sum of 1 alone), 3 (the sum of 1 and 2), 6 (the sum of 1, 2, and 3), and so on.
I'm not looking for a answer, just some ideas on where to start. I was able to create an application that sums the integers from 1 to 50 and displays the answer 1275, but I'm not sure how to go about writing an app that shows the sum for every n.
thanks for any help.
the question is:
Write an application that shows the sum of 1 to n for every n from 1 to 50. That is, the program prints 1 (the sum of 1 alone), 3 (the sum of 1 and 2), 6 (the sum of 1, 2, and 3), and so on.
I'm not looking for a answer, just some ideas on where to start. I was able to create an application that sums the integers from 1 to 50 and displays the answer 1275, but I'm not sure how to go about writing an app that shows the sum for every n.
thanks for any help.
Comment