using System; namespace Example38 { /// /// Summary description for Class1. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { int[] nums = new int[10]; for (int i = 0; i < nums.Length; i++) { nums[i] = i; } // Reverse the contents of the array for (int i = 0; i < nums.Length; i++) { // Swap int temp = nums[i]; nums[i] = nums[(nums.Length - 1) - i]; nums[(nums.Length - 1) - i] = temp; } for (int i = 0; i < nums.Length; i++) { Console.WriteLine("nums[" + i + "]=" + nums[i]); } } } }