ei guys
i really need help on how to give an output like this:
-1 -1 -1 -1 -1 0
-1 -1 -1 -1 0 1
-1 -1 -1 0 1 1
-1 -1 0 1 1 1
-1 0 1 1 1 1
0 1 1 1 1 1
im stuck in this part of my program:
# include <stdio.h>
# define r 6
# define c 6
void matrix (int a[r][c]);
void display(int a[r][c]);
int main()
{
int table[r][c];
matrix(table);
display(table);
return 0;
}
void matrix (int b[r][c])
{
int i, j;
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
b[i][j]=-1;
}
}
}
void display(int b[r][c])
{
int i, j;
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("%d",b[i][j]);
}
printf("\n");
}
}
it only displays the -1's i can't figure out how to place the 0s and 1s in the matrix