-2
Read a vector D of 10 elements. Create an array E, with all elements of D in the order inverse, ie, the last element will become the first, the penultimate will be the second and so from above. Write all vector D and all vector E. Could someone help me ? One of the codes I tried:
int v[]=new int[3];
int z[]=new int[3];
for (int i = 0; i < v.length; i++) {
v[i]=dado.nextInt();
}
for (int i = z.length ; i >= 0; i++) {
z[i]=v[i];
}
for (int i = 0; i < z.length; i++) {
System.out.println(z[i]);
}
And what is your doubt before the exercise?
– user28595
I’m not able to add The values of vector v in z inversely, could help me ?
– Julio Souza