title: 4 queens algorithm - can't understand code
body: <pre><code>public boolean canPlaceQueen(int r, int c) {
      /**
       * Returns TRUE if a queen can be placed in row r and column c.
       * Otherwise it returns FALSE. x[] is a global array whose first (r-1)
       * values have been set.
       */
      // System.out.println("r======"+r);
      // System.out.println("c="+c);
      for (int i = 0; i &lt; r; i++) {
          System.out.println("iiiiiiiiiii="+i);
          if (x[i] == c || (i - r) == (x[i] - c) ||(i - r) == (c - x[i]))
          {
               System.out.println("try c="+c);
               System.out.println("try="+r);
              return false;
  
          }
      }
      return true;
  
  }
  
  public void placeNqueens(int r, int n) {
      /**
       * Using backtracking this method prints all possible placements of n
       * queens on an n x n chessboard so that they are non-attacking.
       */
      //System.out.println("r="+r);
      for (int c = 0; c &lt; n; c++) {
          //System.out.println("c=="+c);
          if (canPlaceQueen(r, c)) {
              x[r] = c;
             // System.out.println("2nd==="+r);
              if (r == n - 1) {
                  printQueens(x);
              } else {
                  placeNqueens(r + 1, n);
              }
          }
      }
  }
  </code></pre>
  
  <p>My question is: If c = 0, then c = 1, but then c=0. I cant understand that logic, why not c=2,please describe it or describe how c increment in this program</p>