I am having extra characters when i am printing

How should I avoid this , not able to change my code to do that