Cognizant interview question

Write a code to remove third element from stack