Sum multiples of 3 and 5: Difference between revisions

Line 256:
=={{header|Java}}==
<lang Java>class Experiment {
public static intlong getSum(intlong n) {
intlong sum = 0;
for (int i = 3; i < n; i++) {
if (i % 3 == 0 || i % 5 == 0) sum += i;
Line 269:
{{out}}
<pre>233168</pre>
 
=={{header|NetRexx}}==
Portions translation of [[#Perl 6|Perl 6]]
Anonymous user