Not getting the expected output. What is wrong with the coding ?

Printable View