Error in program

can you correct the program

@premang you should be calling your recursive function only if placement possible,
look at this image

i edited the code as you have suggested.
but now the code does not work for n=2 and n=3 input.

modified working code : https://ide.codingblocks.com/s/234874

@premang you cannot place queens in a board with less than 4x4 indices.

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.