in reply to Simple iteration problem

1) You don't check if open succeeds. That's bad.

2) If you want to substract, why do you use strings?

3) Assignment is =, not eq