Here\'s a bit of code which prints out the squares of the numbers from 0 to 9:
for (int i = 0; i < 10; i++) Console.WriteLine(i*i);
Doin
Take a look at LINQ TakeWhile or for your specific case of integers, use Enumerable.Range
Enumerable.Range(1, 10).Select(i => ...);
Arguably you shouldn't be putting an Action on the end there, see comments on ForEach here.