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 int32?
What is ulong in c#?
In which order the destructor is called for an inherited class?
Give some examples of commonly used i/o classes?
Which .gang of four. Design pattern is shown below?
What is the difference between paramaterized constructor and copy constructor?
How many types of constructors are there?
Explain the concepts of cts and cls(common language specification).
Explain constructor in c#?
What's the c# syntax to catch any possible exception?
What is uint16?
Is int a class in c#?
What is addressof operator?
What is a virtual property. Give an example?
What is marshalling and what are different kinds of marshalling?