RosettaCodeData/Task/Loops-Do-while/OCaml/loops-do-while-5.ocaml
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07: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 -> ()