for (i=0, flag=0;i<3;i++)
{
for (j=0;j<3;j++)
{
// not here flag = 0;
if ( arr[i][j] == N) {
flag =1;
break;
}
}