Jump to content

Sum multiples of 3 and 5: Difference between revisions

→‎{{header|BASIC}}: from history I see that perhaps a count was intended, not a sum
(→‎{{header|BASIC}}: from history I see that perhaps a count was intended, not a sum)
Line 3:
== {{header|BASIC}} ==
{{works with|FreeBASIC}}
{{incorrect||(Or if the function is right, then the outputtask description should say 'count of multiples of 3 or 5 no greater than a given number.' or issome wrongsuch...)}}
<lang basic>Declare function mulsum35(n as integer) as integer
Function mulsum35(n as integer) as integer
Line 19:
{{out}}
467
 
=={{header|Perl 6}}==
<lang perl6>sub sum35($n) { [+] grep * %% (3|5), ^$n; }
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.