=================================Slip
8_1================================= Write a VB Program to accept a
number from user and check whether it is palindrome or not (Accept
number using input box ) and display result using message box.
========================================================================
Private Sub Command1_Click()
Dim no As Integer
Dim no2 As Integer
Dim sum As Integer
no =
Val(Text1.Text)
no2 = no
While no
r
= no Mod 10
sum
= sum * 10 + r
no
= no \ 10
Wend
If no2 = sum Then
MsgBox
("Number is palindrome")
Else
MsgBox
("Number is not palindrome")
End If
End Sub
No comments:
Post a Comment
Note: only a member of this blog may post a comment.