for the HP 42S
LCM/GCD - Least common multple and Greatest common divisor of two positive integers

Input
Output

Program list
LCMGCD - Rev.1.0 : Jan. 20 2012
 00 { 27-Byte Prgm }
 01>LBL "LCM"
 02 RCL ST Y
 03 RCL ST Y
 04>LBL 00
 05 MOD 
 06 LASTX 
 07 X<>Y
 08 X≠0?
 09 GTO 00 
 10 +
 11 R↑
 12 RCL× ST Z
 13 RCL÷ ST Y
 14 RTN
 15 .END.


Download 'LCMGCD Rev.1.0' (gcdlcm.raw, 30 byte, raw program file for the Free42)
www.finetune.co.jp [Mail] Copyright (c) HOSODA Takayuki. All rights reserved.
Powered by
 Finetune