I did not understand this code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i, j;
for(i=1; i<5; i++) {
for(j=1; j<5; j++) {
if(i==j)
printf("1 ");
else
printf("0 ");
}
printf("\n");
}
system("pause");
return 0;
}
It assigns value 1 if it is true and 0 for false, but if the two are the same, I did not understand, because only one vertical line 1. and not all 1.
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1