tags:

views:

129

answers:

2

Say you have a variable n1 which will be the value of three digits entered

how can i then without knowing what exactly will be input split n1 into 3 seperate integers to do futher calculations with?

+4  A: 

divide by 10 in a loop and take the modulo?

andras
A: 

It turns out that you do actually want to use a string. What you want to do is read a string as input and then break it down into the various segments. You would find the first 3 digits and turn it into an integer in n1, then read the next 2 digits and turn them into n2, etc.

Gabe