What is wrong with the code?

I’m getting the wrong output.