PALINDROME WORD
DECLARE FUNCTION REV$ (S$)
CLS
INPUT "ENTER ANY STRING"; S$
PRINT "PALINDROME WORD IS ";REV$(S$)
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
CLS
INPUT "ENTER ANY STRING"; S$
PRINT "PALINDROME WORD IS ";REV$(S$)
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
Comments
Post a Comment