RosettaCodeData/Task/Loops-Do-while/OCaml/loops-do-while-5.ocaml
2023-07-01 13:44:08 -04:00

9 lines
165 B
Text

let v = ref 0
exception Exit_loop
try while true do
incr v;
Printf.printf "%d\n" !v;
if not(!v mod 6 <> 0) then
raise Exit_loop;
done
with Exit_loop -> ()