Reverse the Input string


Module Module1

Sub Main()
'program to reverse the input string

'declaring the variables
Dim Index As Integer
Dim temp, reverse, inputed_string As String

Console.WriteLine("Enter the String")
inputed_string = Console.ReadLine()

reverse = ""

Index = Len(inputed_string)

While Index <> 0
temp = Mid(inputed_string, Index, 1)
reverse = reverse & temp
Index = Index - 1
End While
Console.WriteLine("The reversed string is =" & " " & reverse)
Console.ReadKey()

End Sub

End Module

Comments

Popular posts from this blog

Program to extract vowel from the input string

Check whether the input number is arm-strong or not

Print the factorial value of an input number