Option explicit
Dim val, res
val=inputbox("Enter any value : ")
res=strreverse(val)
If val=res Then
msgbox(val&"
is a Palindrome.")
else
msgbox(val&"
is not a Palindrome.")
End If
OR
Option explicit
Dim val, res
val=inputbox("Enter any value : ")
res=strreverse(val)
If strcomp(val,res)=0 Then
msgbox(val&"
is a Palindrome.")
else
msgbox(val&"
is not a Palindrome.")
End If
No comments:
Post a Comment