# Palindrome or not. (function)

DECLARE FUNCTION PAL$( n$)
CLS
INPUT "Enter any word";n$
P$=PAL$(n$)
IF n$=p$ THEN
PRINT "palindrome "
ELSE
PRINT" Not palindrome "
END IF
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 FUNCTION

Comments

Popular posts from this blog