title: Moving parts right in two - dimensional matrix
body: <p>I would like to get your help to understand and finish my program.  </p>
  
  <p>This is what I have to do:</p>
  
  <blockquote>
    <p>"You must exercise program that:<br>
    First. An absorbing two - dimensional integer arr [M] [N]. M - number of rows N - number of columns. (Matrix size was received from the user)<br>
    Two. The program uses auxiliary functions "shift" moves the values ​​of the matrix to the right one place, as shown in the picture (2 entered instead of 1, 3 instead of 2, 4 instead of 3, ... 20 instead of 19, first place 20).<br>
    Shift have to write a function and call her three times in the sample matrix loop .."</p>
  </blockquote>
  
  <p>Example
  <a href="https://i.stack.imgur.com/wnXYG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wnXYG.jpg" alt="enter image description here"></a></p>
  
  <p>My problems are:</p>
  
  <ol>
  <li>I don't know how to do the matrix two - dimensional integer arrays that there size is entered by the user. I only know  by DEFINE SIZE of the row and the cols</li>
  <li>My function isn't close to the real deal so I would like to get help finish my function.</li>
  </ol>
  
  <p>My output:</p>
  
  <p><a href="https://i.stack.imgur.com/1J4rP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1J4rP.jpg" alt="my execution"></a></p>
  
  <p>My code:</p>
  
  <pre><code>#include "stdio.h"
  #include "conio.h"
  #include "stdlib.h"
  #define M 4
  #define N 5
  void shift (int arr[M][N], int length); 
  
  void main()
  {
      int arr[M][N];
      int i,j,length;
  
      printf("Enter %d rows \n",M);
      for (i=0 ; i&lt;M ; i++ )
      {
          printf("Enter %d numbers:\n",N);
          for(j=0 ; j&lt;N ; j++ )
          { 
              scanf("%d" , &amp;arr[i][j] );
          }
      length=N+M;
      }
      shift (arr,length);
      system("pause");
      return ;
  }
  
  void shift (int arr[M][N], int length) 
  {    
      int i,j,temp;
      temp=arr[0][0];
      for(i=0; i&lt;M; i++)
      {
               for(j=0; j&lt;N-1 ; j++)
               {
                   printf("%d ",arr[i][j]);
  
               }
               arr[i][j]=temp;
               printf("\n");
      }
  } 
  </code></pre>
  
  <p>Edit: pictures resized</p>