Skip to main content

Write a VB Program to display the reverse of a given number using function. (Accept number through textbox and display result using message box

· One min read
Kaustubh Kulkarni
Private Sub Command1_Click()  
Dim n As Integer
n = Val(Text1.Text)
Dim a As Integer
Dim r As Integer

While n <> 0
a = n Mod 10
r = r * 10 + a
n = n 10
MsgBox ("revers is" & r)
End Sub