Sunday, March 22, 2009

Puzzle 8 – Solution

The key here is the local variable ‘i’ is overwritten every time the inner for loop runs.

The Loop iterate in the manner depicted below,

Outer Loop : i = 0
Inner Loop : i = 0 to 5
Outer Loop : i = 6
Inner Loop : i = 0 to 5
Outer Loop : i = 6
and this pattern keeps repeating.

Congrats to
1. Joe Smith
2. Tanzy
for getting the correct answer.

Joe & Tanzy - you can leave a link to your profile/blog or site if you want it to show up in the Top Score Section.

No comments:

Post a Comment

Solution for this question?