For loop not working properly

Printable View