Why my third condition is not passing?I am getting correct output. please help