What's the last digit Runtime error

Hello guys,i am trying to solve this question but i get Runtime error while going through this approach.Can you please have a look at it.Thanks

Here is the link to your updated code!

hello sir,actually what code you see in my solution is taken from here
http://www.codechef.com/viewsolution/2080366
can you plz tell me whats the difference between two.And it would be best if you can explain it too.I just took the code but barely understand it :stuck_out_tongue:

sir please tell me what’s the difference between the two my code and this solution’s code.I have taken the code from very reputed programmer.Can i use his code or some fault is there.Thanks