using System; using System.Linq; class Program { static void Main() { // Input arrays int[] array1 = { 8, 2, 6, 4 }; int[] array2 = { 9, 1, 5, 3, 7 }; // Union of both arrays (removing duplicates) var unionArray = array1.Union(array2).ToArray(); // Sort the result in ascending order Array.Sort(unionArray); // Output the result Console.WriteLine(string.Join(" ", unionArray)); } }