DotNetSolutions
Monday, April 15, 2013
Linq query Top 5 rows in c#
public void Linq()
{
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var first3Numbers = numbers.Take(5);
Console.WriteLine("First 5 numbers:");
foreach (var n in first5Numbers)
{
Console.WriteLine(n);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment