Search This Blog

Tuesday, October 22, 2019

Program to check whether the given no is Armstrong number or not using FUNCTION

DECLARE FUNCTION ARM(N)
CLS
INPUT"ENTER ANY NUMBER";N
A=P
P=ARM
IF A=P THEN
PRINT"The given no is armstrong"
ELSE
PRINT"The given no is not armstrong"
END IF
END

FUNCTION ARM(N)
S=0
WHILE N<>0
R=N MOD 10
S=S+R^3
N=N\10
WEND
ARM=S
END FUNCTION

No comments:

Post a Comment

My journy with Jagat Mandir

10 years of journy with JM it was the most important day of my life i spend my 10 years with this school . I am so happy that i could spend...