hii....
initially initialise top = -1 and variable max with some value......
suppose max = 4;
...removed spoonfed code