Sum multiples of 3 and 5: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) (REXX added -- another result :-)) |
Walterpachl (talk | contribs) m (→{{header|BASIC}}: 467 is the number of numbers not their sum) |
||
Line 4: | Line 4: | ||
{{works with|FreeBASIC}} |
{{works with|FreeBASIC}} |
||
{{incorrect||(Or if the function is right, then the task description should say 'count of multiples of 3 or 5 no greater than a given number.' or some such...)}} |
{{incorrect||(Or if the function is right, then the task description should say 'count of multiples of 3 or 5 no greater than a given number.' or some such...)}} |
||
<br>I'd suggest to change s += 1 to s += I |
|||
<br>REXX also finds 467 numbers |
|||
<lang basic>Declare function mulsum35(n as integer) as integer |
<lang basic>Declare function mulsum35(n as integer) as integer |
||
Function mulsum35(n as integer) as integer |
Function mulsum35(n as integer) as integer |