Largest of three numbers

    Last updated November 30, 2026

    Compare a with b, then compare the larger of those with c. The chart has three decisions and one result. FlowSimp is completely free to use — no sign-up required.

    See the flowchart

    What does the flowchart look like?

    Ready to draw?

    No signup. Opens instantly in your browser.

    See the flowchart

    What is the matching code?

    Pseudocode

    read a, b, c
    if a >= b then
      if a >= c then largest = a
      else largest = c
    else
      if b >= c then largest = b
      else largest = c

    Python

    def largest(a, b, c):
        if a >= b:
            return a if a >= c else c
        return b if b >= c else c

    C

    int largest(int a, int b, int c) {
      if (a >= b) return a >= c ? a : c;
      return b >= c ? b : c;
    }
    • Equal values are allowed. If a and b are equal and both beat c, the Yes path reports a.
    • A rectangle holds a result. A diamond holds a comparison. Start and End are circles.