Simple interest

    Last updated November 30, 2026

    Interest is principal × rate × years ÷ 100, where rate is a percent. The amount is principal plus that interest. A negative input is refused. 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 principal, rate, years
    if any value is negative then refuse
    interest = principal * rate * years / 100
    amount = principal + interest

    Python

    def simple_interest(principal, rate, years):
        if principal < 0 or rate < 0 or years < 0:
            raise ValueError("negative")
        interest = principal * rate * years / 100
        return interest, principal + interest

    C

    #include <stdio.h>
    void simple_interest(double principal, double rate, double years) {
      double interest, amount;
      if (principal < 0 || rate < 0 || years < 0) return;
      interest = principal * rate * years / 100.0;
      amount = principal + interest;
      printf("interest %.2f\namount %.2f\n", interest, amount);
    }
    • Principal 1000, rate 5 percent, and 2 years gives interest 100 and amount 1100.
    • Rate is a percent in this chart. A rate already written as 0.05 would need a different formula.