Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
Stack<int> stack = new Stack<int>();
stack.Push(10);
stack.Push(20);
stack.Push(30);
Console.WriteLine("Top Element (Peek): " + stack.Peek());
Console.WriteLine("Popped: " + stack.Pop());
Console.WriteLine("Popped: " + stack.Pop());
Console.WriteLine("Remaining Stack Count: " + stack.Count);
}
}Coding works best on desktop or with an external keyboard.