Sum multiples of 3 and 5: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) m (→{{header|BASIC}}: 467 is the number of numbers not their sum) |
Walterpachl (talk | contribs) m (typo in suggestion) |
||
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 += |
<br>I'd suggest to change s += 1 to s += i |
||
<br>REXX also finds 467 numbers |
<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 |