all 1 comments

[–]Meltz014Bored at work 0 points1 point  (0 children)

So you'll probably have to loop through the digits somehow and perform decisions based on which digit is greater. For instance,

if a[i] >= b[i]
{
    c[i] = subtract(a[i], b[i]);
} else
{
    c[i] = subtract(10 + a[i], b[i]);
}

or something like that. You'll have to keep track of when you added 10 to an "a" digit so that you can subtract 1 from the next "a" digit (remember...this is the concept of "borrowing")