Code:
Module Module1
Sub Main()
Dim ar As Integer()
Dim flag As Integer = 0
Dim to_search As Integer
ar = New Integer() {15, 8, 1, 6, 34, 7, 5, 342, 4, 7}
Console.WriteLine("Please enter the integer that you want to search")
to_search = Console.ReadLine()
For i = 0 To ar.GetUpperBound(0)
If to_search = ar(i) Then
flag = 1
Exit For 'Optional, to exit from loop when condition is true first time
End If
Next
If flag = 1 Then
Console.Write("The element {0} exists in the array", to_search)
Else
Console.Write("The element {0} doesn't exist in the array", to_search)
End If
Console.ReadLine()
End Sub
End Module