using System;
class Program
{
static void Main()
{
int[] arr = new int[] { 1, 2, 3, 4 };
for (int i = 0; i < arr.Length; i++) {
Console.Write("{0, 3}", arr[i]);
}
// Resize the array while preserving its contents
Array.Resize(ref arr, 6);
Console.WriteLine();
for (int i = 0; i < arr.Length; i++) {
Console.Write("{0, 3}", arr[i]);
}
}
}
/*
run:
1 2 3 4
1 2 3 4 0 0
*/