Post Reply 
(12C) LCM <> GCD
01-06-2018, 10:14 AM (This post was last modified: 07-30-2018 01:50 AM by Gamo.)
Post: #1
(12C) LCM <> GCD
Program to find LCM and GCD with two integers.

Code:

STO 0
X<>Y
STO 1
X≤Y
X<>Y
X<>Y
 -
LSTx
X<>Y
X=0
GTO 13
GTO 04
X<>Y
STO 2
RCL 0
RCL 1
 x
RCL 2
 ÷
GTO 00

Example:
LCM(256, 562) is 71936 --> 256 ENTER 562 R/S
GCD(256, 562) is 2 -------> X<>Y

LCM(12345, 67890) is 55873470 ---> 12345 ENTER 67890 R/S
GCD(12345, 67890) is 15 -----------> X<>Y

Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) LCM <> GCD - Gamo - 01-06-2018 10:14 AM



User(s) browsing this thread: 1 Guest(s)