Program to verify Armstrong Number in QBASIC
CLS
INPUT "Enter number to verify Number is Armstrong or Not"; num
n = num
Sum = 0
WHILE (num <> 0)
re = num MOD 10
num = num \ 10
Sum = Sum + re ^ 3
WEND
IF (n = Sum) THEN
PRINT "It is Armstrong Number"
ELSE
PRINT "It is not Armstrong Number"
END IF
END
0 Comments
Thank You ! For your love