This is my program, and it works with all no.s except multiples of 2.
org 100h
MOV CX,0000H
MOV DS,CX
MOV SS,CX
MOV SI,5000H
MOV DI,5002H
MOV [ DS:SI ],10H
MOV [ DS:DI ],20H
MOV SP,600FH
MOV BX,[ DS:SI ]
CMP BX,[ DS:DI ]
JZ E1
JC SMALL
THIK: MOV BX,0001H
OK: MOV AX,[ DS:SI ]
MOV DX,0000H
DIV BX
CMP DX,0000H
JZ L1
L2: INC BX
CMP [ DS:DI ],BX
JC HCF
JMP OK
SMALL: MOV AX,[ DS:DI ]
MOV [ DS:DI ],BX
MOV [ DS:SI ],AX
JMP THIK
L1: MOV AX,[ DS:DI ]
DIV BX
CMP DX,0000H
JNZ L2
PUSH BX
INC CX
JMP L2
HCF: MOV AX,0001H
AGAIN: POP BX
MUL BX
DEC CX
JNZ AGAIN
LCM: MOV BX,AX
MOV AX,[ DS:SI ]
MUL [ DS:DI ]
DIV BX
E1 : INC DI
INC DI
MOV [ DS:DI ],AX
ret
To find a pair of numbers with a given GCF, take the GCF number and double it. The pair of numbers is the GCF, and two times the GCF. For instance, two numbers with a GCF of 3 are 3 and 6.
You need at least two numbers to find a GCF.
If one of the numbers is a multiple of the other, the smaller number is the GCF. If the two numbers are prime numbers, the GCF is 1. If the numbers are consecutive, the GCF is 1. If the numbers are consecutive even numbers, the GCF is 2.
To find a GCF, you need at least two numbers.
You need at least two numbers to find a GCF.
To find a pair of numbers with a given GCF, take the GCF number and double it. The pair of numbers is the GCF, and two times the GCF. For instance, two numbers with a GCF of 3 are 3 and 6.
You don't; you need at least two numbers to find a GCF.
You need at least two numbers to find a GCF.
You need at least two numbers to find a GCF. The GCF of 21 and 42 is 21.
You need at least two numbers to find a GCF.
You need at least two numbers to find a GCF.
You need at least two numbers to find a GCF.
You need at least two numbers to find a GCF. If that's 72 and 96, the GCF is 24.
If one of the numbers is a multiple of the other, the smaller number is the GCF. If the two numbers are prime numbers, the GCF is 1. If the numbers are consecutive, the GCF is 1. If the numbers are consecutive even numbers, the GCF is 2.
You need at least two numbers to find a GCF.
You need at least two numbers to find a GCF. If that's 16 and 66, the GCF is 2.
You need at least two numbers to find a GCF.