title: c array on a single line
body: <p>I have to do a bubble sort with pointers for my class.
  I am having trouble with the output
  I want every array sort to be on a single line, not individual lines for each element.</p>
  
  <p>Here is an array example that I would want to print.
  <em>I flipped the 1 and 9 to ensure that I was printing the proper value, not the location, when it was returning just one number.</em></p>
  
  <p>[9, 2, 3, 4, 5, 6, 7, 8, 1]</p>
  
  <p>Here is what it prints</p>
  
  <p>[9]</p>
  
  <p>[2]</p>
  
  <p>[3]</p>
  
  <p>[4]</p>
  
  <p>[5]</p>
  
  <p>[6]</p>
  
  <p>[7]</p>
  
  <p>[8]</p>
  
  <p>[1]</p>
  
  <p>How do I get this sample array onto just one line?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define MAX 9
  
  int val[] = {9, 2, 3, 4, 5, 6, 7, 8, 1};
  int i;
  
  int main(){
      for (i = 0; i &lt; MAX; i++
          { printf ("[%d]\n", val[i]);
      }
  
      return (0);
  }   //end main
  </code></pre>
  
  <p>Now I have read that you cant output to one line.  I keep reading that you need each element to output individually.  The prof has the sample output for the bubble pointer showing that all elements of the array remain on the same line.  What am I missing?</p>
  
  <p><em>FYI this is not the bubble sort with pointer.  I am just needing help getting this sample array to output properly.</em>
  <strong>This must be in C, NOT C++, or C#.</strong></p>