rombik.
Open editor
← All examples

Sum 1..n (recursion)

Java Recursion

recursion

Flowchart (ISO 5807)

YesNoStartInput nn == 0Return 0EndReturn n + sumTo(n - 1)EndFigure 1 — R.sumTo

Source code

class R {
    static int sumTo(int n) {
        if (n == 0) {
            return 0;
        }
        return n + sumTo(n - 1);
    }
}

Next

  • All flowcharts for Java
  • All example flowcharts
  • How to make a flowchart from code
  • Flowchart to the standard: full guide
  • Flowchart for coursework
  • Nassi-Shneiderman structograms

Code to flowchart by language

PythonJavaScriptTypeScriptCC++C#JavaGoPHPPascal

© 2026 rombik — flowcharts per ISO 5807.

Built by Олексій Одарчук (ishawyha)

Service provided by Nadiia Odarchuk, Individual Entrepreneur (FOP)

How it works Guides Gallery Structograms Telegram bot Editor API
About Offer Privacy
Telegram channel Support