RosettaCodeData/Task/Flow-control-structures/REXX/flow-control-structures-5.rexx

19 lines
471 B
Rexx
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
sum=0
2014-01-17 05:32:22 +00:00
do j=1 to 1000
if j//3==0 | j//7==0 then iterate
sum=sum+j
end /*j*/
2013-04-10 21:29:02 -07:00
/*shows sum of 1k numbers except those divisible by 3 or 7.*/
say 'sum='sum
2013-10-27 22:24:23 +00:00
...
2013-04-10 21:29:02 -07:00
numeric digits 5000
prod=0
2014-01-17 05:32:22 +00:00
do k=1 to 2000
do m=1 to k
if m>99 then iterate k
prod=prod*m
end /*m*/
end /*k*/
2013-04-10 21:29:02 -07:00
say 'prod=' prod