public static void Main()
string[] stack = new string[52];
Console.WriteLine(peek(top, stack));
push( ref top, stack,"Ace of Spade");
push( ref top, stack, "Ace of Heart");
push( ref top, stack, "Ace of Club");
push( ref top, stack, "5 of Heart");
push( ref top, stack, "9 of Club");
Console.WriteLine(peek(top, stack));
push( ref top, stack, "King of Spade");
Console.WriteLine(pop(ref top, stack));
Console.WriteLine(peek(top, stack));
public static bool is_empty(int top)
public static bool is_full (int top)
public static string peek(int top, string[] stack)
{ Console.WriteLine( "Error! The Stack is empty ");
public static void push( ref int top, string[] stack, string data)
if (is_full(top) == true)
{ Console.WriteLine("the stack is full"); }
public static string pop(ref int top, string[] stack)
if (is_empty(top) == true)
{ Console.WriteLine("the stack is empty");
string temp = stack[top];