This is a continuation of this article I wrote earlier today.

There was a bug in my Basic program when calculating the value of the two-digit number:

140 p=f+10*l:sm=sm+p:print n,p,sm

That should of course be:

140 p=f*10+l:sm=sm+p:print n,p,sm

After rewriting the code I got this answer:

999 : 33 , 53194

So adding 999 two-digit numbers gave me 53194. Would that be the correct answer?


What have I learned?

Always use simple examples to test your algorithm.