in reply to How do I write a program that calculates the sum of all numbers to a number, n?
$n = 13; $sum = 0; $sum += $n-- while $n; print $sum;; 91 [download]