197k views
1 vote
How to find HCF and LCM of a number in Q Basic program?? ​

User Weekend
by
5.5k points

1 Answer

4 votes
CLS
INPUT "Enter the first number"; a
INPUT "Enter the second number"; b
m = a
n = b
WHILE a <> 0
r = b MOD a
b = a
a = r
WEND
l = (m * n) / b
PRINT "HCF is "; b
PRINT "LCM is "; l
User AZhao
by
5.4k points