- using System;
- using System.Collections.Generic;
-
- namespace exercise_78
- {
- class Program
- {
- public static void Main(string[] args)
- {
-
- int[] array = new int[5];
- array[0] = 1;
- array[1] = 3;
- array[2] = 5;
- array[3] = 7;
- array[4] = 9;
-
- int index = 0;
- while (index < array.Length)
- {
- Console.WriteLine(array[index]);
- index++;
- }
- Console.WriteLine("");
-
-
-
- Console.WriteLine("Give two indices to swap: ");
- int n = Convert.ToInt32(Console.ReadLine());
- int t = Convert.ToInt32(Console.ReadLine());
-
- Console.WriteLine("");
- index = 0;
- while (index < array.Length)
- {
- Console.WriteLine(array[index]);
- index++;
- }
- }
- }
- }
anyone with code how to swap user input arrays