##05AB1E, 8 bytes## vyÈiyˆëq **Explanation** v # for each y in input yÈi # if y is even yˆ # push y to global array ëq # else terminate program # implicitly print global array [Try it online](http://05ab1e.tryitonline.net/#code=dnnDiGl5y4bDq3E&input=WzQyLCAxNCwgNDIsIDQzLCA0MSwgNDA4MDYyMiwgMTcxNDgwMzcyXQ)