View Single Post
Old 09-08-2008, 03:06 AM   PM User | #2
icm9768
New Coder

 
Join Date: Jun 2005
Posts: 32
Thanks: 0
Thanked 2 Times in 2 Posts
icm9768 is an unknown quantity at this point
A fairly straight forward approach would be to multiply your existing number by 10 and then add the new digit.

So in your example below the user enters 5. Since your initial number would be zero the operation would be ( 0 * 10 ) + 5. Now your calculator input is five. Then the user enters 3 so the next operation would be ( 5 * 10 ) + 3. Now the user input is 53 and so on and so forth.
icm9768 is offline   Reply With Quote
Users who have thanked icm9768 for this post:
Crazydog (09-08-2008)