Instead of using base 2^32, use base 2^30. Then when you add two values the largest sum will be 2^31-1 which fits into an ordinary long
(signed or unsigned).
Or better still, use base 10^9 (roughly equal to 2^30), then you don't need a lot of effort to print the large numbers in decimal format.
If you really need to work in base 2^32, you could try a kludge like the following, provided unsigned int
s don't throw overflow exceptions:
sum = term1 + term2
carry = 0
if (sum < term1 || sum < term2)
carry = 1