public static void Main()
Console.Write("Enter input of array : ");
int[] arr = ShowArray(input);
Console.Write("Enter the medium is ");
string showArr = string.Join("-", arr);
Console.WriteLine(showArr);
int[] arr1 = { 2, 1, 4,5,11 };
int[] arr2 = { 2, 4, 1,8,5 };
if (CompareTwoArray(arr1,arr2))
Console.WriteLine("Two arrays are same");
Console.WriteLine("Two arrays are not same");
Console.WriteLine("-----------Option------------");
Console.WriteLine("1. Sorted Array Asc");
Console.WriteLine("2. Sorted Array Desc");
Console.WriteLine("3. Delete Element In Array");
Console.WriteLine("4. Compare 2 arrays");
Console.Write("Choose option : ");
int option = int.Parse(Console.ReadLine());
int[] ArrSortedAsc = SortUpAscending(arr);
Console.Write("Sorted Array Asc is ");
string showArrSortedAsc = string.Join("-", ArrSortedAsc);
Console.WriteLine(showArrSortedAsc);
int[] ArrSortedDesc = SortUpDescending(arr);
Console.Write("Sorted Array Desc is ");
string showArrSortedDesc = string.Join("-", ArrSortedDesc);
Console.WriteLine(showArrSortedDesc);
Console.Write("Enter the element to be deleted : ");
int element = int.Parse(Console.ReadLine());
DeleteElementInArray(arr, element);
Console.WriteLine("Choose option again");
static bool CompareTwoArray(int[] arr1,int[] arr2)
for (int i = 0; i < arr1.Length; i++)
for (int j = 0; j < arr2.Length; j++)
static void DeleteElementInArray(int[] arr,int input)
for (int i = 0; i < arr.Length; i++)
for (int j = i; j < arr.Length-1; j++)
for (int i = 0; i < arr.Length-1; i++)
Console.WriteLine(arr[i]);
static int[] SortUpAscending(int[] arr)
for (int i = 0; i < arr.Length-1; i++)
for (int j = min+1; j < arr.Length; j++)
static int[] SortUpDescending(int[] arr)
for (int i = 0; i < arr.Length - 1; i++)
for (int j = min + 1; j < arr.Length; j++)
static void Swap(int start,int end,int[] arr)
static int[] ShowArray(int input)
int[] arr = new int[input];
for (int i = 0; i < arr.Length; i++)
Console.Write("Enter number "+i+" : ");
var result = int.TryParse(Console.ReadLine(), out input);
Console.WriteLine("Please enter number again");
result = int.TryParse(Console.ReadLine(), out input);