Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as OCaml by Sal ( 15 years ago )
let accum = ref 0;; 
let m3 = ref 0;; 
let m5 = ref 0;; 

for i = 1 to 10 do  
    m3 := i mod 3;
    m5 := i mod 5;
    (*  
    *)
    accum := if (m3 = 0) || (m5 = 0) then !accum + i else !accum + 0;
    print_int (!accum + i); 
    print_newline (); 
done;

 

Revise this Paste

Your Name: Code Language: