Thursday, October 31, 2019

Wap to find the palindrome word

DECLARE FUNCTION REV$ (S$)
CLS
INPUT "ENTER ANY STRING"; S$
P$ = S$
IF P$ = REV$(S$) THEN
PRINT "THE GIVEN WORD IS PALINDROME "
ELSE
PRINT " THE GIVEN NO. IS NOT PALINDROME"
END IF
END

FUNCTION REV$ (S$)
FOR I = LEN(S$) TO 1 STEP -1
B$ = MID$(S$, I, 1)
W$ = W$ + B$
NEXT I
REV$ = W$
END FUNCTION

No comments:

Post a Comment

Journey with jagat mandir

        My journey with Jagat Mandir School My first day and my first step in jagat mandir was on 2067. On the first day I came with my ...