Addition and Subtraction Algorithms (with Flowcharts)

Addition and Subtraction Algorithms (with Flowcharts)

Verified Sources
Nov 4, 2026

Addition and subtraction can be expressed as algorithms: a precise set of steps that transform inputs into outputs. In elementary arithmetic, the most common presentation is column addition (with carrying) and column subtraction (with borrowing). These procedures can be turned into flowcharts to make the decision points (e.g., whether a carry/borrow is needed) explicit.

We’ll cover:

  • Column Addition and its flowchart
  • Column Subtraction and its flowchart
  • (Optional conceptual extension) how the idea matches binary addition/subtraction using carry/borrow logic

Note: I attempted web research, but the web-search tool is currently unavailable due to a usage limit error, so I cannot attach external citations to factual claims. The content below is written from standard algorithmic/mathematical practice and includes no tool-cited statistics.

Flowcharts for Basic Arithmetic Algorithms (Addition/Subtraction)

Key terms (what the flowchart is really controlling)

  • Carry
  • Borrow
  • Digit-wise processing
  • Base (radix)

The flowchart encodes two main “decision points” per digit:

  1. Addition decision: Is the current column sum ≥10\ge 10 so we produce a carry?
  2. Subtraction decision: If the top digit is smaller than the bottom digit, do we borrow?

Column Addition Algorithm (Decimal, with Carry) — flowchart-ready

  1. 1
    Step 1

    Write the two numbers with matching place values (units under units, tens under tens, etc.).

  2. 2
    Step 2

    Set carry = 0. Start from the least significant digit (rightmost).

  3. 3
    Step 3

    Let aia_i and bib_i be the ii-th digits. Compute s=ai+bi+carrys = a_i + b_i + carry.

  4. 4
    Step 4

    Set the result digit ri=s  mod  10r_i = s \,\bmod\, 10.

  5. 5
    Step 5

    Set carry=⌊s/10⌋carry = \lfloor s/10 \rfloor.

  6. 6
    Step 6

    Replace ii with the next more significant digit and repeat steps 3–5 while digits remain.

  7. 7
    Step 7

    If after the last digit carry e0carry \ e 0, append it to the left of the result.

Flowchart: Column Addition (with Carry)

How to read it: For each digit column, the algorithm always computes ss, outputs s,bmod,10s \\,\\bmod\\, 10, and carries ,lfloors/10rfloor\\,\\lfloor s/10 \\rfloor forward.

Pro Tip

When converting a numeric algorithm into a flowchart, every update you do in code (e.g., carry update) becomes a block, and every 'if carry/borrow then...' becomes a decision node (a diamond).

Column Subtraction Algorithm (Decimal, with Borrow) — flowchart-ready

  1. 1
    Step 1

    For standard grade-school subtraction without negative outputs, assume the left number (minuend) is greater than or equal to the right number (subtrahend).

  2. 2
    Step 2

    Align place values exactly like addition (units under units, tens under tens, etc.).

  3. 3
    Step 3

    Set borrow = 0. Start at the least significant digit.

  4. 4
    Step 4

    Let aia_i be the minuend digit and bib_i the subtrahend digit. Compute d=ai−bi−borrowd = a_i - b_i - borrow.

  5. 5
    Step 5

    If d<0d < 0, then you borrow 1 from the next column: set d=d+10d = d + 10 and set borrow = 1.

  6. 6
    Step 6

    If d≥0d \ge 0, set borrow = 0.

  7. 7
    Step 7

    Set result digit ri=dr_i = d and write it in the result place.

  8. 8
    Step 8

    Move to the next digit left and repeat.

  9. 9
    Step 9

    After processing all digits, remove leading zeros in the result (if desired).

Flowchart: Column Subtraction (with Borrow)

How to read it: Each digit column either:

  • subtracts directly (borrow becomes 0), or
  • subtracts “after borrowing” (add 10 and set borrow to 1).

Worked examples (to validate the flowchart)

Example 1: Addition with carry

Compute 587+48587 + 48.

Column (right to left)Digitscarry insum ssresult digit rir_icarry out
Units7+87 + 801551
Tens8+48 + 411331
Hundreds5+05 + 01660

Result: 635635.

Example 2: Subtraction with borrow

Compute 502−368502 - 368.

Column (right to left)Digitsborrow ind=ai−bi−borrowd=a_i-b_i-borrowadjustmentresult digitborrow out
Units2−82-80-6add 10 → 441
Tens0−60-61-7add 10 → 331
Hundreds5−35-311none10

Result: 134134.

Carry/Borrow behavior per digit column

Illustrative counts from the examples above (how many digit-columns needed carry/borrow).

Common edge cases & conceptual notes

How to use the flowcharts in practice

Alignment

1. Prepare digits

Write numbers in columns and ensure place values match."

Addition or Subtraction

2. Choose algorithm

Pick the correct flowchart (carry for addition, borrow for subtraction)."

Right-to-left processing

3. Run digit-by-digit

Follow the decision nodes for carry/borrow at each column."

Append carry / trim zeros

4. Finalize output

After the last digit, append final carry if present; remove leading zeros for subtraction."

Addition & Subtraction Algorithm Flashcards

1 / 4
Question · Term

What is a 'carry' in column addition?

Click to reveal
Answer · Definition

When the digit sum in a column is at least 10, the extra 10s are carried to the next (more significant) column.

Knowledge Check

Question 1 of 4
Q1Single choice

In the decimal column addition algorithm, if s=ai+bi+carrys = a_i + b_i + carry and s=27s = 27, what are the result digit and next carry?