Sum multiples of 3 and 5: Difference between revisions

Added solution for Action!
m (→‎{{header|APL}}: Seperated APL solutions by implementation + added Dyalog solution using gcd)
(Added solution for Action!)
Line 82:
1000000 : 233333166668
10000000 : 23333331666668
</pre>
 
=={{header|Action!}}==
{{libheader|Action! Tool Kit}}
<lang Action!>INCLUDE "D2:REAL.ACT" ;from the Action! Tool Kit
 
PROC Main()
REAL sum,r
INT i
 
Put(125) PutE() ;clear the screen
IntToReal(0,sum)
FOR i=0 TO 999
DO
IF i MOD 3=0 OR i MOD 5=0 THEN
IntToReal(i,r)
RealAdd(sum,r,sum)
FI
OD
 
PrintRE(sum)
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Sum_multiples_of_3_and_5.png Screenshot from Atari 8-bit computer]
<pre>
233168
</pre>
 
Anonymous user