int a; for(a = 0; a < array.length; a++) { if(array[a]%2 == 0) { array[a]*=-1; } System.out.println(array[a]); } } }