Total Pageviews

Tuesday, October 1, 2019

Program to check whether the given word is palindrome string or not using FUNCTION

DECLARE FUNCTION PAL$(N$)
CLS
INPUT"ENTER ANY WORD";N$
P$=PAL$(N$)
IF N$=P$ THEN
PRINT"The given word is palindrome"
ELSE
PRINT"The given word is not palindrome"
END

FUNCTION PAL$(N$)
FOR I= LEN$(N$) TO 1 STEP -1
B$= MID$(N$,I,1)
C$=C$+B$
NEXT I
PAL$=C$
END FUNCITON

No comments:

Post a Comment