VB.net Program to Find the Even Numbers From the Array of Integers

You are currently viewing VB.net Program to Find the Even Numbers From the Array of Integers

VB.Net program to find the EVEN numbers from the array of integers

'VB.Net program to find the EVEN numbers 
'from the array of integers.

Module Module1

    Sub Main()
        Dim arr As Integer() = New Integer(5) {}

        Console.WriteLine("Enter array elements: ")
        For i As Integer = 0 To 4 Step 1
            Console.Write("Element[{0}]: ", i)
            arr(i) = Integer.Parse(Console.ReadLine())
        Next

        Console.WriteLine("EVEN Numbers are: ")
        For i As Integer = 0 To 4 Step 1
            If (arr(i) Mod 2) = 0 Then
                Console.Write("{0} ", arr(i))
            End If
        Next
        Console.WriteLine()
    End Sub
    
End Module
Enter array elements:
Element[0]: 12
Element[1]: 13
Element[2]: 14
Element[3]: 15
Element[4]: 16
EVEN Numbers are:
12 14 16
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply