C# Sharp Exercises: Display the name of the days of a week
C# Sharp LINQ : Exercise-6 with Solution
Write a program in C# Sharp to display the name of the days of a week.
Sample Solution:-
C# Sharp Code:
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();
}
}
Sample Output:
LINQ : Display the name of the days of a week : ------------------------------------------------ Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Pictorial Presentation:
Flowchart:
C# Sharp Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a program in C# Sharp to display the characters and frequency of character from giving string.
Next: Write a program in C# Sharp to display numbers, multiplication of number with frequency and the frequency of number of giving array.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework