Home / MCQ Bank / Computer
Computer Control Flow Statements In C Sharp Difficulty: Medium

What will be the output of the following C# code? static void Main(string[] args) { int i = 10 , j = 0; label: i--; if ( i > 0) { Console.WriteLine(i+ " "); goto label; } Console.ReadLine(); }

Select the correct option to test your answer:

More Computer Questions

A distributed database is which of the following? Given is the code of days(example:"MTWTFSS") which I need to split and hence create a list of days of week in strings( example:"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"). A set of code is given for this purpose but there is the error occurring in that set of code related to the conversion of char to strings. Hence, Select a C# code to solve the given error. static void Main(string[] args) { var days = "MTWTFSS"; var daysArray = days.ToCharArray().Cast<string>().ToArray(); for (var i = 0; i < daysArray.Length; i++) { switch (daysArray[i]) { case "M": daysArray[i] = "Monday"; break; case "T": daysArray[i] = "Tuesday"; break; case "W": daysArray[i] = "Wednesday"; break; case "R": daysArray[i] = "Thursday"; break; case "F": daysArray[i] = "Friday"; break; case "S": daysArray[i] = "Saturday"; break; case "U": daysArray[i] = "Sunday"; break; } } daysArray[daysArray.Length - 1] = "and " + daysArray[daysArray.Length - 1]; Console.WriteLine(string.Join(", ", daysArray)); } How many comparisons will be made in the worst case when an array of size n will be sorted by using a binary insertion sort algorithm? Which of the following is an alternate name of library sort? Apache . . . . . . . . is a platform for building native mobile applications using HTML, CSS and JavaScript (formerly Phonegap).