Im new to java. Im from the philippines. Please check my code.
My goal is to accept 10 numbers using array then print only the even numbers afterwards.
<package javaapplication1;
import java.util.Scanner;
public class JavaApplication1 {
public static void main(String[] args) {
Scanner od = new Scanner (System.in);
/* variables */
int nums [] = new int [10];
int snum []= new int [10];
/* code */
System.out.println("Input 10 Real Numbers and I");
System.out.println("will display the Even numbers entered");
for(int i = 0; i <=10; i++){
nums[i]= od.nextInt();
if(nums[i]%2==0)
{
snum[i] = nums[i];
}
nums[i]= i+1;
}
for (int x = 0; x < snum.length; ++x)
System.out.println(snum[x]);
}
}
>