sir please tell me the correction in this code
Regarding n queen
your is_possible function is the culprit , the condition in while condition should use && operator instead of ||
bool is_possible(int board[][100],int n,int i,int j)
{
for(int x=0;x<i;x++)
{
if(board[x][j]==1) return false;
}
int x=i-1,y=j-1;
while(x>=0 && y>=0) // your code : while(x>=0 || y>=0)
{
if(board[x][y]==1) return false;
x--;
y--;
}
x=i-1,y=j+1;
while(x>=0 && y<n) // your code : while(x>=0 || y<n)
{
if(board[x][y]==1) return false;
x--;
y++;
}
return true;
}
mark your doubt as resolved if you got the answer 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.