QBASIC PROGRAM TO FIND HCF

QBASIC PROGRAM TO FIND HCF OF TWO NUMBERS



CLS
 INPUT ENTER ANY TWO NUMBERS; A, B
 WHILE A MOD B < > 0
 T = A MOD B
 A = B
 B = T
 WEND
 PRINT H.C.F=; B
 END

USING SUB


DECLARE SUB HCF(A,B)
 CLS
 INPUT ENTER ANY TWO NUMBERS; A, B
 CALL HCF(A,B)
 END
 
 SUB HCF(A,B)
 WHILE A MOD B < > 0
 T = A MOD B
 A = B
 B = T
 WEND
 PRINT H.C.F=; B
 END SUB

Post a Comment

0 Comments