Sum multiples of 3 and 5: Difference between revisions

Content added Content deleted
(Lingo added)
Line 1,545: Line 1,545:
233168
233168
2333333333333333333316666666666666666668</pre>
2333333333333333333316666666666666666668</pre>

=={{header|Lingo}}==
<lang lingo>on sum35 (n)
res = 0
repeat with i = 0 to (n-1)
if i mod 3=0 OR i mod 5=0 then
res = res + i
end if
end repeat
return res
end</lang>

<lang lingo>put sum35(1000)
-- 233168</lang>


=={{header|LiveCode}}==
=={{header|LiveCode}}==