QBASIC PROGRAM TO FIND REVESE OF INPUT STRING USING SUB.
DECLARE SUB REV(N$)
CLS
INPUT"ENTER ANY WORD";N$
CALL REV(IN$)
END
SUB REV(N$)
FOR I=LEN(N$) TO 1 STEP-1
B$= MID$(N$,I,1)
C$=C$+B$
NEXT I
PRINT"THE REVERSED WORD=";C$
END SUB
DECLARE SUB REV(N$)
CLS
INPUT"ENTER ANY WORD";N$
CALL REV(IN$)
END
SUB REV(N$)
FOR I=LEN(N$) TO 1 STEP-1
B$= MID$(N$,I,1)
C$=C$+B$
NEXT I
PRINT"THE REVERSED WORD=";C$
END SUB
Comments
Post a Comment