1.

Output for the following set of code is ?
static void Main(string[] args) { { var dayCode = "MTWFS"; var daysArray = new List(); var list = new Dictionary { {"M", "Monday"}, {"T", "Tuesday"}, {"W", "Wednesday"}, {"R", "Thursday"}, {"F", "Friday"}, {"S", "Saturday"}, {"U", "Sunday"} }; for (int i = 0,max = dayCode.Length; i < max; i++) { var tmp = dayCode[i].ToString(); if (list.ContainsKey(tmp)) { daysArray.Add(list[tmp]); } } Console.WriteLine(string.Join(" n ", daysArray)); } 

A. Monday ,Tuesday ,Wednesday ,Friday ,Saturday ,Sunday
B. Monday , Tuesday , Wednesday , Friday . Sunday
C. Monday , Tuesday , Wednesday , Friday , Saturday
D. Monday ,Tuesday ,Wednesday ,Friday ,Saturday
Answer» D. Monday ,Tuesday ,Wednesday ,Friday ,Saturday


Discussion

No Comment Found