Driver code
public static void Main ( ) { StackWithMax s = new StackWithMax ( ) ; s . push ( 20 ) ; Console . WriteLine ( s . getMax ( ) ) ; s . push ( 10 ) ; Console . WriteLine ( s . getMax ( ) ) ; s . push ( 50 ) ; Console . WriteLine ( s . getMax ( ) ) ; } }