Saturday, October 16, 2021

WAP to check if an entered number is Armstrong or not.

WAP to check if an entered number is Armstrong or not.

DECLARE SUB ARM$ (A)
CLS
INPUT ''ENTER A NUMBER";N
END
SUB ARM$ (A)
B=A 
WHILE A< > 0 THEN
R = N MOD 10
S = S+R^3
N = N/10
WEND
IF A=B THEN PRINT ''ARMSTRONG''
ELSE
 PRINT ''NOT ARMSTRONG''
END SUB

No comments:

Post a Comment

Sharkey

Simple way to make website using HTML only.

 A simple way to make a website using HTML only. <!DOCTYPE html> <head>         <title>Document</title> </head...