When user inputs the word using same case only (i.e.uppercase or lowercase)
CLS
INPUT "Enter a word:"; w$
FOR i = LEN(w$) TO 1 STEP -1
m$ = MID$(w$, i, 1)
rev$ = rev$ + m$
NEXT i
PRINT
PRINT "The original word is "; w$
PRINT "The reverse wod is "; rev$
PRINT
IF w$ = rev$ THEN
PRINT "The given word is palindrome"
ELSE
PRINT "The given word is not palindrome"
END IF
END
When user inputs the word using uppercase and lowercase letters.
CLS
INPUT "Enter a word: "; w$
FOR i = LEN(w$) TO 1 STEP -1
rev$ = rev$ + MID$(w$, i, 1)
NEXT i
PRINT
PRINT "The original word is "; LCASE$(w$)
PRINT "The reverse word is "; LCASE$(rev$)
PRINT
IF LCASE$(w$) = LCASE$(rev$) THEN
PRINT "The word is a palindrome"
ELSE
PRINT "The word is not a palindrome"
END IF
END
CLS
INPUT "Enter a word:"; w$
FOR i = LEN(w$) TO 1 STEP -1
m$ = MID$(w$, i, 1)
rev$ = rev$ + m$
NEXT i
PRINT "The original word is "; w$
PRINT "The reverse wod is "; rev$
IF w$ = rev$ THEN
PRINT "The given word is palindrome"
ELSE
PRINT "The given word is not palindrome"
END IF
END
When user inputs the word using uppercase and lowercase letters.
CLS
INPUT "Enter a word: "; w$
FOR i = LEN(w$) TO 1 STEP -1
rev$ = rev$ + MID$(w$, i, 1)
NEXT i
PRINT "The original word is "; LCASE$(w$)
PRINT "The reverse word is "; LCASE$(rev$)
IF LCASE$(w$) = LCASE$(rev$) THEN
PRINT "The word is a palindrome"
ELSE
PRINT "The word is not a palindrome"
END IF
END