Easy. But couldn't find a solution ?

Write a program that finds and prints the sum of all numbers from 1 to 100 (with out loop).
Without loop huh? Simply use the formula sum=n*(n+1)/2... where n will be 100 in your case..
So, to you, not easy?

Hint: you're looking for a formula.
Can't figure it out yet.
Thanks, but can you tell me how you figured out the formula ?
Alright. Thanks for helping. :-)
Always welcome.. :)
Topic archived. No new replies allowed.