programming-examples/c-sharp/Linq/C# Sharp to display the name of the days of a week.cs
2019-11-15 12:59:38 +01:00

21 lines
660 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class LinqExercise6
{
static void Main(string[] args)
{
string[] dayWeek = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
Console.Write("\nLINQ : Display the name of the days of a week : ");
Console.Write("\n------------------------------------------------\n");
var days = from WeekDay in dayWeek
select WeekDay;
foreach (var WeekDay in days)
{
Console.WriteLine(WeekDay);
}
Console.WriteLine();
}
}