How do I write a program that effectively loops WITHOUT using for/do-while/while/etc?

I'm a mentor and was asked a question and for once didn't even know how to answer. The question doesn't make much sense to me in the first place (as far as learning how to do c#) but I'm here to ask it.

They are supposed to write a program that accepts input for a number from the user and then prints a message that variable number of times WITHOUT 'using a loop' (do/do-while/for/foreach explicitly listed).

… Am I crazy or is this a ridiculous question? Either way, I'd like to know what solutions you come up. Keep in mind, these are students who may have not programmed at all before but for sure not in c#. They've only been in this program for a few months so your answer shouldn't include using some crazy ass technique.

Thanks!

by Lanlost via /r/csharp

Leave a Reply