Trying to reverse an Integer

I’m very new to programming, I’m trying to write a program that takes an input as an integer, and then reverses the order of the numbers of said integer. For example if you input 376, the program would output 673. It works for some numbers like 123, but 876 outputs 6891. Here is the algorithm I’m using:

Dim Number As Integer = CInt(Input.Text) Dim Reverse As Integer Dim Remainder as Integer While Number > 0 Remainder = Number Mod 10 Sum = Sum * 10 + Remainder Number = CInt(Number / 10) End While Result.Text = CType(Sum, String) 

submitted by /u/Doobadia
[link] [comments]

Leave a Reply