News for hackers. Stuff that matters.
Re:For loops help - comp.lang.c by johnohara on Wednesday May 12, 2010 @10:30AM (#1341012)
This problem appears in the Deitel and Deitel book "C++ How to Program" as well as in their Java book.

It's a great exercise that challenges CS students every year and does a very good job at teaching nested loops.

Later in the same set of exercises is the four triangles problem that ties increment and decrement operators to the use of nested loops. It's one of my personal favorites.

CS students who legitimately complete these exercises always do well with chapter 4 (Arrays, Simpletron), chapter 5 (pointers) and chapter 6 (structs and classes) and come away with insight and a sense of confidence that echoes for a long time.

It is literally one of those defining problems that separates those who are serious from those who are not.

The responder at comp.lang.c knew that. Kudos to him.

Re:For loops help - comp.lang.c by kmt on Wednesday May 12, 2010 @01:43PM (#1341648)
Exactly. I'm surprised to see many people here saying that the responder was unhelpful or rude. I think that the answer was not only fascinating but also responsible, pedagogical and, in a way, even compassionate.
Re:For loops help - comp.lang.c by cabalamat on Wednesday May 12, 2010 @03:50PM (#1342036)
Not rude, but has waaaay too much time on his hands!
Re:For loops help - comp.lang.c by cabalamat on Wednesday May 12, 2010 @03:51PM (#1342041)
> It is literally one of those defining problems that separates those who are serious from those who are not.

It's up there with FizzBuzz; anyone who can't do it simply isn't up to being a programmer.