I should only present the numbers present in the odd positions of the vector, however I'm locked:
package pag1;
import java.util.Scanner;
import java.util.Arrays;
public class ex1 {
public static void main (String[] args){
Scanner x = new Scanner (System.in);
int posicao = 0;
int[] numeros = new int[10];
System.out.println("Digite 10 números inteiros seguidos:");
while(posicao <= 9){
numeros [posicao] = x.nextInt();
posicao++;
}
System.out.println(Arrays.toString(numeros));
}
}
At the time of showing only the numbers that are in the odd positions do not know how, only show all positions of the vector.