Recents in Beach

Free Website Visitors

Write a program to check whether the given number is Armstrong or not.

Write a program to check whether the given number is Armstrong or not.

 ----------------------------------------------------------------------------------------------------------------------------


DECLARE FUNCTION CHECK(N)

CLS'

INPUT "ENTER ANY NUMBER";N

A=N

ARM=CHECK(N)

IF A=ARM THEN 

PRINT "ARMSTRONG NUMBER"

ELSE

PRINT "NOT ARMSTRONG NUMBER"

END IF 

END 

FUNCTION CHECK(N)

S=0

WHILE N<>0

R=N MOD 10

S=S+R^3

N=N\10

WEND

CHECK=S

END FUNCTION 

-----------------------------------------------------------------------------------------------------------------------------

 CREATED BUY LEARNING CLASSES  

Post a Comment

1 Comments

If you want to know anything about learning . Let me know in comment section.