What will be the output of the following C# code snippet? [code] static void Main() { int[] nums = { 1, 2, 3, 4, 5 }; Console.Write

What will be the output of the following C# code snippet?
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();
 }
A. Run time error
B.
Code:
5, 4, 3, 2, 1
C. Compile time error
D. None of the mentioned
 

Tìm kiếm

Back
Top