From what I know about compilers(not much) - when there is calculation without variables they just compute it on the fly and substitute in the code where possible. And I think this is just what is going on.
You should read the n from the input or given as parameter to the program.
I think it would be nice if there will be a world where you can express such a problem in a decidable mini-language where the compiler can deduce that the answer will be n(n+1)/2. :)
[+] [-] venomsnake|12 years ago|reply
You should read the n from the input or given as parameter to the program.
[+] [-] dmjio|12 years ago|reply
[+] [-] helloTree|12 years ago|reply
[+] [-] gems|12 years ago|reply
[+] [-] dmjio|12 years ago|reply