loop sum

Write a program that asks the user for a positive integer value – use a loop to get the sum of all integers from 1 up to the number entered, e.g., if 50 is entered, the loop finds the sum of 1, 2, 3 … 50.
Input validation: Do not accept a negative starting value.

Anybody know how to do this? Should I use a while or do while?

closed account (48T7M4Gy)
Can be done with either scheme olf the while structure.

PS This site works on the basis of help rather than just asking
Anybody know how to do this?
ie It's not a homework site but if you have a go and show an honest attempt you'll get some help if you are having problems at any stage.

Cheers :)
Topic archived. No new replies allowed.