for loop not working properly

Printable View