Find Palindrom Number...

By Goniey N (Mr. G)

Check Whether Given Number Is Palindrom Or Not Using Console Application...

Sub rev_num(ByRef n As Long)
        
Dim a, rev, i As Long
        a = n
         
While (n > 0)
            i = n
Mod 10
            n /= 10
            rev = (rev * 10) + i
        
End While
      
Console.WriteLine()
      
Console.WriteLine()
      
Console.WriteLine("==============================")
        
If (rev = a) Then
          
Console.WriteLine("  :=> " & a & " is PALINDROM.")
        
Else
          
Console.WriteLine("  :=> " & a & " is Not PALINDROM.")
        
End If
      
Console.WriteLine("==============================")
End Sub


Sub Main()
        
Dim n As Long
      
Console.Write("Enter the Number :=>")
        n =
Console.ReadLine()
        rev_num(n)
      
Console.ReadLine()
End Sub

Find Palindrom Number...  (539 Views)