The original question asked for nested loops. Post #4 showed you're getting the idea. One technique which would work is to have the outer loop (let's say X) step by 5 at a time, and have the inner Y loop go from X to X + 4.
It's important that you learn to understand and be comfortable with loops, including nested loops. They're a very important and heavily-used feature of the language.
jamesd0142, I'd like to make two points. First, using an array seems somewhat over the top for such a simple task. And second, please remember that we don't hand out answers to homework questions (though helping to understand the problem is fine). Oh, and a third point I just thought of. What purpose does your array serve? How is using hold(i) any different to using i?
Oh, and werks... I'm watching you too... ;)
It's important that you learn to understand and be comfortable with loops, including nested loops. They're a very important and heavily-used feature of the language.
jamesd0142, I'd like to make two points. First, using an array seems somewhat over the top for such a simple task. And second, please remember that we don't hand out answers to homework questions (though helping to understand the problem is fine). Oh, and a third point I just thought of. What purpose does your array serve? How is using hold(i) any different to using i?
Oh, and werks... I'm watching you too... ;)
Comment