Search:

Type: Posts; User: helloworld922

Search: Search took 0.10 seconds.

  1. Replies
    7
    Views
    3,523

    [SOLVED] Re: Counting Addition "Carries"

    I don't see why it wouldn't work (at least in theory, there may be some bugs in the implementation):

    0199991
    0000009
    _______
    0200000

    It should count 5 carries.

    To be honest the for-loops...
  2. Replies
    7
    Views
    3,523

    [SOLVED] Re: Counting Addition "Carries"

    Just add an extra zero. Adding two numbers can never go more than 1 digit over the longer of the two numbers. You will need a separate carry variable.

    049 + 051 = 100

    You'd count 2 carries.
    ...
  3. Replies
    7
    Views
    3,523

    [SOLVED] Re: Counting Addition "Carries"

    The simplest way is to take your code and force the two arrays to be the same length (whichever is longer). You can do this by adding zeros to the left ("011" = "11" numerically, should work with...
Results 1 to 3 of 3