• We just launched and are currently in beta. Join us as we build and grow the community.

How to Reverse Set of Numbers in VB.net

jampmopa

Influence Revenue Strategist
J Rep
0
0
0
Rep
0
J Vouches
0
0
0
Vouches
0
Posts
162
Likes
143
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
This simple program can be use as one of your activity in programming subject. It’s kind of interesting to know how to reverse set of numbers especially when done in VB.Net. Surely, your student will have fun learning this simple program.

Creating Application

Step 1

Open Microsoft Visual Studio 2015 and create a new windows form application. After that, do the form just like shown below.
2018-10-08_3.png

Step 2

Double click the form to fire the code view. In the code view, declare an integer and create a function to reverse the given number in the textbox.
  1. Dim

    r As

    Integer
  2. Public

    Function

    Reverse(rn As

    Integer

    )
  3. Dim

    numbers = Val(TextBox1.Text)
  4. Dim

    result As

    Integer
  5. While

    numbers > 0
  6. rn = numbers Mod

    10
  7. result = result * 10 + rn
  8. numbers = numbers \ 10
  9. End

    While
  10. Reverse = result
  11. End

    Function

Step 3

Do the following codes to display the reverse numbers in another textbox when clicked.
  1. Private

    Sub

    Button1_Click(sender As

    Object

    , e As

    EventArgs) Handles Button1.Click
  2. TextBox2.Text = Reverse(r)
  3. End

    Sub

For any questions about this article. You can contact me @

Email – [email protected]
Mobile No. – 09305235027 – TNT
FB Account – https://www.facebook.com/onnaj.soicalap

 

452,292

323,341

323,350

Top