Code not working

https://rextester.com/MLU89692

Hye @acharyadhwanan29
Your code for checking diagonals is wrong. You are checking all rows for all values.
It should be something like
for(int row=i, col=j; i>=0 && j>=0; i–,j–)

Also for a 2D array initialisation with false doesn’t set all values to false like 1D array with some compilers. So look into that as well.

If your doubt is resolved please mark it as closed.