Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write code for palindrome?

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


Please Help Members By Posting Answers For Below Questions

What is the difference between int.parse and int.tryparse methods?

993


What will be the output of the following code?

868


Which sorting algorithm is best?

927


What is streamreader/streamwriter class?

886


If multiple interfaces are inherited and they have conflicting method names; What will happen ?

899


Describe an interface class?

1000


Explain the difference between directcast and ctype.

921


Is list immutable in c#?

836


If you want to convert a base type to a derived type, what type of conversion do you use?

882


Is an interface a type c#?

917


What are the fundamental differences between value types and reference types?

1005


What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?

907


How long does it take to learn c# for unity?

845


What is serialization in c#?

845


What is the process of Serialization?

947