#include<stdio.h>
#define ROW 5
#define COL 5
int main(){
int array[ROW][COL];
int r=0, c=0;
for (r=0; r<ROW; r++){
for (c=0; c<COL; c++)
array[c][r] = (c+1)-(r+1);
}
for (r=0; r<ROW; r++){
for (c=0; c<COL; c++)
printf("%5d", array[c][r]);
printf("\n");
}
printf("\n\n");
system("pause");
return 0;
}
i need help in this code
I need help to modify the code to make it's output
from:
0 1 2 3 4
-1 0 1 2 3
-2 -1 0 1 2
-3 -2 -1 0 1
-4 -3 -2 -1 0
to:
0 1 1 1 1
-1 0 1 1 1
-1 -1 0 1 1
-1 -1 -1 0 1
-1 -1 -1 -1 0