Tsallaka zuwa abun ciki
Justice Tech School

R Repeat and Break

repeat loops forever until break. It suits loops where the exit condition is checked in the middle.

Example
n <- 0
repeat { n <- n + 1; if (n >= 3) break }
print(n)

Exercise

Leave the loop.

if (x) 

Quiz Test

What ends a repeat loop?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.