title: Switching an array's elements in C
body: <p>So i want to switch the elements of an array with 32 integers "n" times.</p>
  
  <p>All elements should be on the next position and the last should be at the first.</p>
  
  <p>I tried something like this:</p>
  
  <pre><code>while(scanf("%d", &amp;n) != EOF)
  {
      for(int j=0; j&lt;n; j++)
      for(int i=1; i&lt;31; i++)
      {
          t[0]=t[31];
          tmp=t[i];
          t[i]=t[i+1];
      }
  }
  </code></pre>
  
  <p>Im not sure how could I use the tmp variable to solve this problem.</p>
  
  <p>this is the array's element: </p>
  
  <p>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 </p>
  
  <p>and it should look like this if the n=1:</p>
  
  <p>32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31</p>