Write a Vb.net program to check whether entered string is palindrome or not.
Program:-
Module slip1
Sub main()
Dim n, newstr As String
Console.Write("Enter String: ")
n = Console.ReadLine()
newstr = ""
For i As Integer = 0 To n.Length() - 1
newstr = n(i) + newstr
Next
If n = newstr Then
Console.WriteLine((CStr(newstr) + " string is palindrome "))
Else
Console.WriteLine((CStr(n) + " string is not palindrome "))
End If
Console.ReadKey()
End Sub
End Module
Output:-
0 Comments