126.
Write a program using FUNCTION to get a word from the user and print
the word in the reverse order.
DECLARE FUNCTION REV$ (S$)
CLS
INPUT "ENTER ANY STRING"; S$
PRINT "REVERSED STRING 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
IT IS ACTUALLY :
ReplyDeleteFOR I=1 TO LEN(S$)
yes your are right
DeleteNOTHING
ReplyDeleteIT IS ALSO FOR N=24
DeleteWhy u print in first statement.why not in last statement
ReplyDelete