i am getting the output but not able to pass last condition