Home/Blog/Guide & Examples

Prime Number Check in a Structogram (DIN 66261)

2026-11-225 min read

Using teiler * teiler <= n

Testing divisors while d * d <= n avoids floating-point square roots while keeping the check O(sqrt(n)).

Live Example (DIN 66261)

Rendered directly in DIN 66261 — click to open and edit in the workspace.

istPrimzahl(n)istPrim = falschistPrim = wahr; teiler = 2istPrim =falschteiler =teiler + 1n MOD teiler == 0wahrfalschteiler * teiler <= n UND istPrimn < 2wahrfalschRückgabe: istPrim

More Articles