Hi guys,
I'm pretty sure I can handle this task, but I don't understand what practically they want from me.
What does it mean:
that it reverses the sign of an element of the array array if the element is even.
How it's supposed to look like, really have no idea.
Thank you in advance!
package en.codegym.task.pro.task05.task0503;
/*
Working with elements of an array
*/
public class Solution {
public static int[] array = new int[]{-1, 2, 3, -4, -5};
public static void main(String[] args) {
main(array);
}
public static void main(int[] array){
for (int i = 0; i < array.length; i++) {
if (array[i]%2!=0 || array[i]==0){
System.out.println(Math.abs(array[i]));
}
}
}
}