Flowchart Updated 12/2/2026

Largest of Three Numbers Flowchart

Flowchart to find largest of three numbers: read a, b and c, ask whether a beats both others, then compare b with c. With a trace table for 12, 45 and 30, pseudocode, and tested Python, C and Java code.

largest of three numbersflowchartif-elsedecisionsprogramming
8 nodes 9 connections

Study guide

Largest of Three Numbers FlowchartStartRead a, b, ca >= b and a >= c?b >= c?Print aPrint bPrint cEndYesNoYesNo
Largest of Three Numbers Flowchart. Source: https://www.chartcraft.dev/examples/largest-of-three-numbers-flowchart

What the largest of three numbers flowchart shows

A flowchart to find largest of three numbers needs no loop, just two well placed decisions. The first asks whether a is at least as big as both others; if not, the winner must be b or c, so a single comparison settles it.

Think of it as a knockout: once a is out, only one match is left.

Largest of three numbers flowchart, step by step

  1. terminator StartOne Start terminator opens the flowchart.
  2. input/output Read a, b, cThree numbers come in at once. One parallelogram can hold all three inputs.
  3. decision a >= b and a >= c?The key question. a wins only if it is at least b and at least c. Using >= instead of > means ties still produce an answer.
  4. decision b >= c?Reached only when a lost, so the largest is b or c. One comparison decides between them.
  5. input/output Print aPrints a, the largest value.
  6. input/output Print bPrints b. We know a is not the unique largest and b >= c.
  7. input/output Print cPrints c, which beat b after a was ruled out.
  8. terminator EndThree arrows meet at the one End terminator. Exactly one Print box runs on any input.

Dry run: trace table for a = 12, b = 45, c = 30

Follow the flowchart with 12, 45 and 30. Each row is one decision diamond.

StepDiamondWith the numbersAnswerNext step
1a >= b and a >= c?12 >= 45 and 12 >= 30NoGo to b >= c?
2b >= c?45 >= 30YesPrint b (45)

Two questions were enough. No input ever needs more than two.

Largest of three numbers pseudocode

Pseudocode
READ a, b, c
IF a >= b AND a >= c THEN
    PRINT "Largest is", a
ELSE IF b >= c THEN
    PRINT "Largest is", b
ELSE
    PRINT "Largest is", c
ENDIF

Largest of three numbers in Python, C and Java

Python
a, b, c = map(int, input().split())

if a >= b and a >= c:
    largest = a
elif b >= c:
    largest = b
else:
    largest = c

print("Largest is", largest)
C
#include <stdio.h>

int main(void) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);

    int largest;
    if (a >= b && a >= c) {
        largest = a;
    } else if (b >= c) {
        largest = b;
    } else {
        largest = c;
    }

    printf("Largest is %d\n", largest);
    return 0;
}
Java
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();

        int largest;
        if (a >= b && a >= c) {
            largest = a;
        } else if (b >= c) {
            largest = b;
        } else {
            largest = c;
        }

        System.out.println("Largest is " + largest);
    }
}
Input typed at the keyboard
12 45 30
Output of all three programs
Largest is 45

All three programs were compiled and run with the input 12 45 30 before this page was published, and they print exactly the output shown. The programs store the winner in largest and print once, which does the same job as the three Print boxes.

Mistakes examiners see most

  • Comparing a with only one other number. a > b alone does not make a the largest: try 5, 3, 9. The first diamond must check both b and c.
  • Using > and losing ties. With a > b and a > c and the input 7, 7, 2, the flowchart falls through and prints 2 if the second test is also strict. >= keeps ties safe.
  • Asking about b again after a lost. Some answers test b >= a in the second diamond. It is not needed: once the first diamond said No, the largest is already b or c.
  • Leaving a decision exit unlabelled. Every diamond needs Yes and No on its two arrows. See the if-else statement flowchart for the basic pattern.

Practice questions with worked answers

Q1 Trace the flowchart for a = 8, b = 8, c = 3. What is printed?

First diamond: 8 >= 8 is true and 8 >= 3 is true, so the answer is Yes.

The output is Largest is 8. Because of >=, the tie between a and b causes no trouble.

Q2 Draw the version with nested decisions only (no and). How many diamonds does it need?

Three diamonds. First ask a >= b?. On Yes, ask a >= c? (Yes prints a, No prints c). On No, ask b >= c? (Yes prints b, No prints c).

Pseudocode
IF a >= b THEN
    IF a >= c THEN PRINT a ELSE PRINT c
ELSE
    IF b >= c THEN PRINT b ELSE PRINT c
ENDIF

It still asks only two questions on any one run, but the diagram has three diamonds and two Print c boxes, or one Print c box with two arrows into it.

Q3 Extend the idea to the largest of N numbers. What new symbol appears?

Read the first number into max. Then loop: read the next number x, ask x > max?, and on Yes set max = x. Repeat until N numbers are read, then print max.

The new part is a loop, a flow line that goes back up to an earlier step, like in the for loop flowchart.

Flowchart symbols used and why

SymbolShape to draw on paperWhere it appears hereWhy
TerminatorRounded boxStart and EndOne entry and one exit, even though three paths lead to the end.
Input/outputParallelogramRead a, b, c and the three Print boxesThey move data into or out of the program.
DecisionDiamonda >= b and a >= c? and b >= c?Yes-or-no questions with two labelled exits each.
Flow lineArrowEvery arrowArrows show the order. Here none of them points back up, so there is no loop.

In the interactive diagram every step is a labelled card: the small word above each step names its kind (process, decision or data). When you draw this flowchart by hand, use the standard shapes in the table. The full list is on the flowchart symbols page.

Make your own version

Each link opens the editor with a prompt already filled in. Change the wording, then generate your own flowchart.

How can I use this flowchart?

Download the Largest of Three Numbers Flowchart as a PNG or SVG, or open it in the studio to edit your own copy. To draw a similar flowchart from a description, use the flowchart generator; for notation and a step-by-step walkthrough, read how to make a flowchart; and browse more flowchart examples for related layouts.

Try the studio with your own description.

Type any system, process, or schema in plain English. ChartCraft will draw it in seconds.