title: How make a bar chart in C?
body: <p>I have written a program that prints out the integers in the same order as the input with 5 numbers per line. That is, the first 5 integers will be printed in the first line; the next 5 integers in the next line; and so on. I was also was trying to print out the numbers in a bar chart format, like,</p>
  
  <pre><code>81-105 ( 1) x
  56-80 ( 5) xxxxx
  6-11(5) xxxxx
  -1-5 (3) xxx
  </code></pre>
  
  <p>My program:</p>
  
  <pre><code>cntr=0;
   while (fscanf(in, "%d", &amp;a[i]) != EOF)
     {i++;
  
   fprintf(out, "%d-%d (%d) %s\n", A, B, k, x, cntr);
   fprintf(out, "%d\n", k, cntr);
  
      fprintf(out, "x", a[i]);
      i++;
     }
  
     fprintf(out, "1864-2336 (%d)%s\n", k, x);
     fprintf(out, "1391-1863 (%d)%s\n", k, x);
     fprintf(out, "918-1390 (%d)%s\n", k, x);
     fprintf(out, "445-917 (%d)%s\n", k, x);
     fprintf(out,"-28-444 (%d)%s\n", k, x);
      fclose(in);
      fclose(out);
  return 0;
  }
  </code></pre>