PALINDROME OR NOT (FUN)
DECLARE FUNCTION PAL$(N$)
CLS
INPUT"ENTER ANY WORD';N$
P$=PAL$(N$)
IF N$=P$ THEN
PRINT"THE GIVEN WORD IS PALINDROME"
ELSE
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
CLS
INPUT"ENTER ANY WORD';N$
P$=PAL$(N$)
IF N$=P$ THEN
PRINT"THE GIVEN WORD IS PALINDROME"
ELSE
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
Post a Comment