Separate negative from positive numbers
Anonymous
int[] arr = new int[] {-1, -2, 3, 5, 1, -6, 9, -8}; for(int i = 0; i < arr.length; i++{ if(arr[i] < 0) System.out.Println("Negative: "); System.out.Println(arr[i]); else System.out.Println("Positive: "); System.out.Println(arr[i]); }
Check out your Company Bowl for anonymous work chats.