title: display binary strings without consecutive 1’s
body: <p>How can i modify the below backtracking code which is used to display all the combinations of N digit binary number <em>to</em> display binary number which doesn't have consecutive 1's?
  example:
  Input:  N = 2
  Output: 3
  // The 3 strings are 00, 01, 10</p>
  
  <p>Input: N = 3
  Output: 5
  // The 5 strings are 000, 001, 010, 100, 101</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  char target[100];
  void foo(int size, int count)
  {
      if (count &gt; size)
          return;
      if (count == size) {
          target[count] = '\0';
          printf("%s\n", target);
          return;
      }
      if (count &lt; size) {
          target[count] = '1';
          foo(size, count+1);
      }
      target[count] = '0';
      foo(size, count+1);
  }
  
  int main()
  {
      int n = 3;
      foo(n, 0);
      return 0;
  }
  </code></pre>