using System.Collections;
public static void Main()
int[] myArray = new int[5];
Console.WriteLine("Enter elements of the array:");
Console.WriteLine("---------------------------------------");
for(int i = 0; i < 5; i++){
Console.WriteLine("element - {0}: ", i);
myArray[i] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Now I'll print the array back to you!");
for(int i = 0; i < myArray.Length; i ++){
Console.Write(myArray[i] + " ");
Console.WriteLine("Now I'll sum the elements in the array for you!");
for(int i = 0; i < myArray.Length; i++){
Console.WriteLine("The sum of the array elements is " + sum + ".");
ArrayList myAL = new ArrayList();
Console.WriteLine("Enter elements of the ArrayList:");
Console.WriteLine("---------------------------------------");
for(int i = 0; i < 5; i++){
Console.WriteLine("element - {0}: ", i);
myAL.Add(Console.ReadLine());
foreach(Object obj in myAL){
Console.Write("{0} ", obj);