title: VB.net console application to print Reverse of number
body: <p>I am trying to print reverse of number using VB.NET console application and I have variable of type Integer. when I give  number 651 as input it prints 1561. I have write code as </p>
  
  <pre><code>Sub Main()
      Dim no, rev, temp As Integer
      Console.WriteLine("enter the no")
      no = CInt(Console.ReadLine())
      rev = 0
      temp = no
      While temp &gt; 0
          Dim t As Integer
          t = temp Mod 10
          rev = rev * 10 + t
          temp = temp / 10
      End While
      Console.WriteLine("Reverse number=&gt;"+rev.ToString())
      Console.ReadKey()
  End Sub
  </code></pre>
  
  <p>when I enter number 123 then it gives proper output as 321, but when i give 678,it give output 8761 or other garbage value, please suggest me suggetion</p>