stack program added

Please describe program with proper comments.