You're trying to do three things at once which is never a good idea.
You essentially need to know the answer to three questions:
Is there a queen in the same column?
Is there a queen in the same row?
Is there a queen on a diagonal?
The best approach is to write separate methods for those, so your SafeToPlace() can then look something like:
if (QueensInColumn() == 0 && QueensInRow() == 0 && QueensOnDiagonal() == 0)
return 1;
return 0;
There are a great many advantages to breaking code down into discreet elements (you will probably come across the Single Responsibility Principle at some point) not least of which is that it makes it an awful lot easier to debug your code. In this example, if it keeps getting it wrong for the diagonal but works for rows and columns, you know exactly where to look and you won't find yourself changing the bits that are already working.
Another hint for easier debugging (and all round better code) is to use more meaningful variable names. Use of labels like a, i, j, k, l etc. make your code very hard to read and code that is hard to read is hard to maintain.
As a third point, you seem to be trying to apply 1-based indexes to a 0-based index language and confusing yourself in the process. 0-base everything and things should get a bit clearer.