Exercise
Array of even numbers
Objetive
Write a java program to ask the user for 10 integer numbers and display the even ones.
Example Code
import java.util.*;
public class Main
{
public static void main(String[] args)
{
int[] numbers = new int[10];
for (int i = 0; i < 10; i++)
{
System.out.printf("Numero %1$s= ", i + 1);
numbers[i] = Integer.parseInt(new Scanner(System.in).nextLine());
}
for (int i = 0; i < 10; i++)
{
if (numbers[i] % 2 == 0)
{
System.out.printf("%1$s ", numbers[i]);
}
}
}
}