Skip to content
EspañolWorkspace →

PSeInt Redon: round to the nearest whole number

Rounds to the nearest whole number. Exactly halfway (.5) rounds up.

Template
Redon
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.

redon-round.psc · 3 lines
Algoritmo Example    Escribir Redon(2.5), " ", Redon(2.4)FinAlgoritmo

Output

Shows: 3 2

This is what the console shows when the example runs.

3 2

In a flowchart

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

nota ← Redon(promedio)
Used inside a calculation. It has no shape of its own; it's used inside a calculation. Flowchart: a process rectangle reading "nota ← Redon(promedio)", 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.

Redon · 1 line
Redon(<numero>)

Examples that use it

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

  • Tip Calculator

    Splits a restaurant bill, tip included.

    Beginner
  • Body Mass Index

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

    Intermediate
  • Modular Menu

    A unit converter with a menu that keeps coming back.

    Intermediate
  • Geometry

    Finds a circle's area and solves a right triangle.

    Intermediate
  • Compound Interest

    Watch your savings grow year by year.

    Intermediate
  • Class Grade Book

    Records three grades per student and builds a class report.

    Advanced
See every Math example →

More math functions

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.