Stack programming in c#

Jitendrasoft09
Posted by Jitendrasoft09 under C# category on | Points: 40 | Views : 760
using System;
using System.Collections.Generic;

namespace MyExample {
class JkExample {

static void Main(string[] args) {

Stack<string> stack = new Stack<string>();

stack.Push("BCA");
stack.Push("MCA");
stack.Push("MTech");

stack.Pop();

foreach (string s in stack) {
Console.WriteLine("Stack Item: {0}", s);
}


Console.ReadLine();
}
}
}

Comments or Responses

Login to post response