How can I get full marks and what is error?

what is the error in my code for the above question …why cant I get full marks even though the code is running