Hey, thanks! As to you first question, the numbers in ASCII are sequential, so 0-9 have code 48-57. Stopping execution you can do with loops, since they stop executing if the current value is zero, you just have to design the loop in such a way that it reads in the next value as the last step, so that if that happens to be 0, it stops.
But in this task, you're not trying to print the numbers, you just wanna read in and convert the ASCII codes to the numerical values, essentially making the two bands the same.
I'll leave it at that so you can work it out yourself, but if you want more hints, let me know :)