I am trying to print numbers from 1 to 100 without using loops, using C#. Any clues?
Enumerable.Range(1, 100)
.Select(i => i.ToString())
.ToList()
.ForEach(s => Console.WriteLine(s));
Not sure if this counts as the loop is kind of hidden, but if it's legit it's an idiomatic solution to the problem. Otherwise you can do this.
int count = 1;
top:
if (count > 100) { goto bottom; }
Console.WriteLine(count++);
goto top;
bottom:
Of course, this is effectively what a loop will be translated to anyway but it's certainly frowned upon these days to write code like this.