The link to my code is http://ideone.com/4Iv8pE I am unable to understand why it is showing wrong answer