using System.Collections;
public static void Main(string[] args)
Console.WriteLine("ELEMENTS IN STACK ARE : ");
Console.WriteLine("now top element is removed using pop and elements of stack are : ");
Console.WriteLine("CHECKING WHETHER AN ELEMENT IS PRESENT IN STACK");
Console.WriteLine(s.Contains("new stack"));
Console.WriteLine("GETTING TOP ELEMENT THROUGH PEEK()");
Console.WriteLine(s.Peek());
object[] obj = new object[5];
Console.WriteLine("after copying all elements of stack to array so elements of array are:");
Console.WriteLine("\nNOW WE CLEARED STACK SO ITS EMPTY");
Console.WriteLine("giving input at runtime from user to store in stack");
s.Push(Console.ReadLine());
Console.WriteLine("Now displaying element entered by user from stack");