Answer Posted / sayan
Private Sub btnAnswer_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnevaluate.Click
Dim Input As String
If IsPalindrome(Input) Then
txtAnswer.Text = "True"
Else
txtAnswer.Text = "False"
End If
End Sub
Function IsPalindrome(ByVal Input As String) As Boolean
Dim Front As Integer
Dim Back As Integer
Dim Middle As Integer
Dim nPalindrome As Boolean
IsPalindrome = False
nPalindrome = True
Back = Input
Middle = Back / 2
Front = 1
If (Back < 1) Then
Exit Function
End If
Do While (Front <> Back And Front <= Middle)
If (Mid(Input, Front, 1) <> Mid(Input, Back, 1)) Then
nPalindrome = False
Exit Do
End If
Back = Back - 1
Front = Front + 1
Loop
IsPalindrome = nPalindrome
Exit Function
End Function
End Class
Is This Answer Correct ? | 7 Yes | 6 No |
Post New Answer View All Answers
What is serializable in c#?
Explain how many types of exception handlers are there in .net?
Why is c# better than java?
How do you declare an arraylist?
Can we instantiate abstract class in c#?
What are the Types of compatabilities and explain them
What is difference between comparable and comparator?
What is transparent caching with aop ?
In a memory when you Box and Unbox a value-type what happens?
Define parsing?
Is c# good for beginners?
Which class comes after the SortedList class?
How does a while loop work?
Where value types are stored in c#?
What is lazy loading c#?