Program to check whether the given no is palindrome or not using FUNCTION
DECLARE FUNCTION PAL(N)
CLS
INPUT"ENTER ANY NUMBER";N
P=PAL((N))
IF N=P THEN
PRINT"The given no is palindrome"
ELSE
PRINT"The given no is not palindrome"
END IF
END
FUNCTION PAL(N)
S=0
WHILE N<>0
R= N MOD 10
S=S*10+R
N=N\10
WEND
PAL=S
END FUNCTION
CLS
INPUT"ENTER ANY NUMBER";N
P=PAL((N))
IF N=P THEN
PRINT"The given no is palindrome"
ELSE
PRINT"The given no is not palindrome"
END IF
END
FUNCTION PAL(N)
S=0
WHILE N<>0
R= N MOD 10
S=S*10+R
N=N\10
WEND
PAL=S
END FUNCTION
No comments:
Post a Comment