Visual Basic .NET :)
Imports System.Console
Module Module1
Sub Main()
Dim Rnd As Random = New Random()
Dim A(5), B(5) As Integer
Dim k As Integer
Dim i As Byte
For i = 0 To A.Length - 1
A(i) = Rnd.Next()
WriteLine("A({0}) => {1}", i, A(i))
Next
WriteLine()
i = 0
For Each k In A
If (k Mod 2 = 0) Then
B(i) = k
i = i + 1
End If
Next
For k = 0 To i - 1
WriteLine("B({0}) => {1}", k, B(k))
Next
ReadKey(False)
End Sub
End Module