for (i=0; i<=9; i++)
for (j=0; j<=9; j++)
if (A[i][j]!=0) {
B[i] = A[i][j];
}
System.out.print("Vector : ");
for(int i1 = 0; i1 < B.length; i1++){
System.out.print(B[i1] + " ");
} array = true;
System.out.println();
I have 10x10 array with 55 values that are different from 0 and i need to make from those 55 numbers one vector. The problem is that with this code i have, it prints only 10 numbers that are not 0 and other 45 zeros. It takes all values from row 10 and nothing else. I think there is something wrong with B[i] but im not sure. Maybe someone can help?