Skip to content
EspañolWorkspace →

Multiplication in PSeInt: the * operator

Multiplies two numbers. It's worked out before addition and subtraction, just like in maths.

Group:
Algebraic
Template
*
Open it in Codoritmo

Opens the editor with this example loaded. Run it step by step and watch the flowchart.

Worked example

A complete algorithm, ready to copy and run.

multiplication-operator.psc · 3 lines
Algoritmo Example    Escribir 2 + 3 * 4FinAlgoritmo

Output

Shows: 14 (first 3 * 4 = 12, then 2 + 12)

This is what the console shows when the example runs.

14

Common mistake

Use parentheses to change the order: (2 + 3) * 4 gives 20.

In a flowchart

This is how it appears in a flowchart, with the same shapes Codoritmo draws.

area ← base * altura
Used inside a calculation. It has no shape of its own; it's used inside a calculation. Flowchart: a process rectangle reading "area ← base * altura", with one arrow in and one arrow out.
Draw the flowchart of your own algorithm →

Template

The general form. Replace what's inside < > with your own data.

* · 1 line
*

Examples that use it

Programs from the example library where it appears, from the simplest to the most complete.

  • Temperature Converter

    Converts degrees Celsius to Fahrenheit and Kelvin.

    Beginner
  • Tip Calculator

    Splits a restaurant bill, tip included.

    Beginner
  • Coffee Shop Menu

    Pick a drink from the menu and get the total to pay.

    Beginner
  • Times Table

    Prints the multiplication table for the number you choose.

    Beginner
  • Body Mass Index

    Computes your BMI and classifies it as underweight, normal and so on.

    Intermediate
  • Binary Search

    Finds a value in a sorted array by halving the range every step.

    Intermediate
See every Math example →

More algebraic

Codoritmo is an independent, open-source project inspired by PSeInt and compatible with its syntax. It is not affiliated with the PSeInt project. Official PSeInt website.