Code is correct, but incorrect output?

Printable View