Been struggling with this a few times now and have inserted some additional printf commands to try and understand what's going on with the variables used to control my loops (please see instructions, code and output in screenshot below).
Think the issue is with the set-up of the innermost loop on line 20. Have fiddled about a bit but can't figure it out.
Any thoughts or suggestions appreciated.
Many thanks!
Siôn