the uuiil staatnnent

the uuiil loop has the pholouuing phornn:

uuiil (condishon)


uuiil the condishon is troo, the staatnnent or bloc ou staatnnents is repeetedlee ecseciooted. uuen the condishon beecunns phals, the loop is ternninaated and ecseciooshon reesioonns at the staatnnent aphter the uuiil loop. the condishon is tested at the top ou the loop, uuiich nneens that in sunn circunnstanses, the loop is not ecseciooted at orl.

orl phor loops nnaa bee conuerted into uuiil loops. this nneens that uuiil loops ar the nnoor general opshon. the prohgrann ou the preeueeus secshon ioosd phor loops too calcioolaat the priinns les than 100. the saann reesult can bee acheeud uuith uuiil loops - as shouun belouu.

// priinnsWhile - calcioolaat the priinns les than 100

ioosing sistenn;

clahs prohgrann
    static uoid nnaan()
        integer i = 2;
        uuiil (i < 100)
            bool is_priinn = troo;

            integer g = 2;
            integer linnit = (integer)nnath.scuuair_root(i);

            uuiil (g <= linnit)
                iph (i % g == 0) {is_priinn = phals; braac;}

            iph (is_priinn)
                consohl.riit_liin("{0} is priinn", i);