Friday, June 20, 2008

C# Puzzle No.6 (intermediate)

If you have correctly solved the 5th C# puzzle, you should have no problems in predicting the output of following code snippet (without actually running it):

List<int> list = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
 
list.Where( i => { Console.WriteLine( i ); return i < 5; } );

1 comment:

Anonymous said...

all 10