title: Finding numbers with unique digits in C
body: <p>I have to write a program that finds every number (except 0) which can be factored by numbers from 2-9.
  For example first such a number would be number 2520 as it can be divided by every single number from 2 to 9.
  It also has to be a number that contains only 1 type of digit of its own (no multiple digits in a number). So for example 2520 will not meet this requirement since there are two same digits (2). The example of a number that meets both requirements is number 7560. That is the point I don't how to do it. I was thinking about converting value in an array to string, and then putting this string in another array so every digit would be represented by one array entry.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main() {
      int i, n, x, flag, y = 0;
      scanf("%d", &amp;n);
      double z = pow(10, n) - 1;
      int array[(int)z];
  
      for (i = 0; i &lt;= z; i++) {
          flag = 0;
          array[i] = i;
          if (i &gt; 0) {
              for (x = 2; x &lt;= 9; x++) {
                  if (array[i] % x != 0) {
                      flag = 1;
                  }
              }
  
              if (flag == 0) {
                  y = 1;
                  printf("%d\n", array[i]);
              }
          }
      }
  
      if (y == 0) {
          printf("not exist");
      }
  
      return 0;
  }
  </code></pre>