| kythlyn (5) | ||
|
Hi all! Can someone walk me through the example below and how it comes to 12206? I'm having trouble following. Thank you, -Ari
| ||
|
Last edited on
|
||
| Chervil (1206) | |
| Which part don't you understand? Is it the for-loop, or the array itself, or some particular line? | |
|
|
|
| kythlyn (5) | |
|
The for-loop... Is n++ just adding 1 over and over until N=5? And then for the result... I just get all confused. I'm not sure I understand the math going on in this loop. | |
|
|
|
| kythlyn (5) | |
|
I may have just figured it out... first time through the loop n=0, so billy =16... result becomes 16... Second time through n=1, so result becomes 16+2=18... and so on... +77... +40... +12071... Yup, there's the 12206. Haha, thanks for making me look at it closer. :) | |
|
Last edited on
|
|
| Chervil (1206) | |
| That's good. Sorry I didn't help directly, but if you got there in the end, great. | |
|
|
|