What is wrong in my code since my code is displaying wrong answer please help me where I am wrong with my logic.