Site icon Pathshala Nepal

Write a program to input a string and print the reverse of the string.

Q BAISC OS
Online Calculator

Write a program to input a string and print the reverse of the string.


1 Answer


CLS

INPUT"ENTER A STRING";S$

FOR I = LEN(S$) TO 1 STEP -1

B$ = MID$ (S$, I, 1)

R$ = R$ + B$

NEXT I

PRINT"THE REVERSED STRING=";R$

END

Topics from Computer
Related Questions