in reply to Re^4: How do I write a program that calculates the sum of all numbers to a number, n?
in thread How do I write a program that calculates the sum of all numbers to a number, n?
More fun! Thanks. Parens work. Probably another way that I don’t know too.
> say [+] ^1+$n 14 > say [+] ^++$n+1 15 > say [+] ^($n+1) 91 > say [+] ^++$n 105 > say [+] ^$n++ 105
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How do I write a program that calculates the sum of all numbers to a number, n?
by raiph (Deacon) on Feb 25, 2015 at 01:23 UTC | |
|
Re^6: How do I write a program that calculates the sum of all numbers to a number, n?
by Tux (Canon) on Feb 25, 2015 at 11:20 UTC |