Does anyone know how to solve my mistake? It goes infinite loop

enter image description here

I got the correct answer, just the display issue. I want to know how to fix it. Thank you guys!