// Pantea Aria // static 2D arrays: similar to a Matrix // Write a program that declares the following 2D array of integers // { // {1, 0, -1}, // {2, -2, 4}, // {0, 5, 3} // } // and prints all negative elements, one row per line, space-separated. // { // {1, 0, -1}, // {2, -2, 4}, // {0, 5, 3} // } #include int main(void) { int array[3][3] = {{1, 0, -1}, {2, -2, 4}, {0, 5, 3}}; int i = 0; while(i < 3) { int j = 0; while(j < 3) { if (array[i][j] < 0) { printf("%3d\n", array[i][j]); } j++; } i++; } }