Nguyễn Thị Lan
New member
What will be the output of the following C# code snippet?
A. Run time error
B.
C. Compile time error
D. None of the mentioned
Code:
static void Main()
{
int[] nums = { 1, 2, 3, 4, 5 };
Console.Write("Original order: ");
foreach(int i in nums)
Console.Write(i + " ");
Array.Reverse(nums);
Console.Write("Reversed order: ");
foreach(int i in nums)
Console.Write(i + " ");
Console.WriteLine();
}
B.
Code:
5, 4, 3, 2, 1
D. None of the mentioned