Friday, December 28, 2018

11. Write a progra to find whether the supplied word is palindrome or not. A word is called palindrome, if it reads the same from both the sides. (e.g. MADAM)

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