Jump to content

Increasing gaps between consecutive Niven numbers: Difference between revisions

→‎{{header|REXX}}: elided the 2nd REXX version.
(Added Perl example)
(→‎{{header|REXX}}: elided the 2nd REXX version.)
Line 527:
 
=={{header|REXX}}==
===add digits serially===
<lang rexx>/*REXX program finds and displays the largest gap between Niven numbers (up to LIMIT).*/
parse arg lim . /*obtain optional arguments from the CL*/
Line 592 ⟶ 591:
276 1,039,028,518 18,879,988,824
</pre>
<!-- not ready for prime time ...
 
===add digits in chunks===
Line 637:
commas: parse arg _; do c=length(_)-3 to 1 by -3; _=insert(',', _, c); end; return _
tell: say arg(1); return</lang>
{{out|output|text=&nbsp; is identical to the 1<sup>st</sup> REXX version.}} <br><br> --!>
 
=={{header|zkl}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.