static void Main(string[] args)
Console.Write("Input the size of the array: ");
if (int.TryParse(Console.ReadLine(), out int size) && size > 0)
int[] firstArray = new int[size];
int[] secondArray = new int[size];
Console.WriteLine($"Input {size} elements in the first array:");
for (int i = 0; i < size; i++)
Console.Write($"element - {i} : ");
if (int.TryParse(Console.ReadLine(), out int element))
Console.WriteLine("Invalid input. Please enter a valid integer.");
for (int i = 0; i < size; i++)
secondArray[i] = firstArray[i];
Console.WriteLine("The elements stored in the first array are:");
foreach (int element in firstArray)
Console.Write(element + " ");
Console.WriteLine("\nThe elements copied into the second array are:");
foreach (int element in secondArray)
Console.Write(element + " ");
Console.WriteLine("Invalid input. Please enter a positive integer for the size of the array.");