WAP to check entered number is palindrome or not using subprocedure.
DECLARE SUB-PALI$ (P)
CLS
INPUT ''ENTER A NUMBER"; N
CALL PALINDROME (N)
END
SUB PALINDROME (P)
A=N
WHILE A<>0
R=N MOD 10
S=S*10 +R
N=N/10
WEND
IF N=A THEN PRINT ''PALINDROME"
ELSE
PRINT "NOT PALINDROME"
END SUB
No comments:
Post a Comment