title: 2d-arrays in bubble sorting
body: <p>I'm trying to create a 2d-array in bubble sort, arranged <code>25</code> numbers <code>5</code> by <code>5</code> in ascending order</p>
  
  <p>my inputs</p>
  
  <pre><code>Enter 25 integers:
  Input No.[0][0]: 4
  Input No.[0][1]: 5
  Input No.[0][2]: 8
  Input No.[0][3]: 9
  Input No.[0][4]: 4
  Input No.[1][0]: 2
  Input No.[1][1]: 1
  Input No.[1][2]: 0
  Input No.[1][3]: 2
  Input No.[1][4]: 4
  Input No.[2][0]: 6
  Input No.[2][1]: 7
  Input No.[2][2]: 4
  Input No.[2][3]: 5
  Input No.[2][4]: 5
  Input No.[3][0]: 4
  Input No.[3][1]: 8
  Input No.[3][2]: 9
  Input No.[3][3]: 1
  Input No.[3][4]: 2
  Input No.[4][0]: 4
  Input No.[4][1]: 5
  Input No.[4][2]: 2
  Input No.[4][3]: 1
  Input No.[4][4]: 9
  </code></pre>
  
  <p>my output shows</p>
  
  <pre><code>Ascending:
    4  4  5  8  9
    0  1  2  2  4
    4  5  5  6  7
    1  2  4  8  9
    1  2  4  5  9
  </code></pre>
  
  <p>as you can see its not in proper arranged, it only arranged the 5 numbers each lines not the whole numbers</p>
  
  <p>can anybody help arranged my integers like this</p>
  
  <pre><code>Ascending:
        0  1  1  1  2
        2  2  2  4  4
        4  4  4  4  5
        5  5  5  6  7
        8  8  9  9  9
  </code></pre>
  
  <p>this is my code so far</p>
  
  <pre><code>int main(){
  
      int rows = 5, cols = 5;
      int arr[rows][cols];
      int i,j,k,swap;
  
  
      printf("Enter 25 integers:\n");
  
      for(i = 0; i &lt; rows; i++){
          for(j = 0; j &lt; cols; j++){
  
       printf("Input No.[%d][%d]: ", i+0,j+0);
       scanf("%d", &amp;arr[i][j]);
      }
  }
  
      for(k = 0; k &lt; rows; k++){   
          for(i = 0 ; i &lt; cols; i++){
              for(j = i + 1; j &lt; cols; j++){
  
          if(arr[k][i] &gt; arr[k][j]){
  
          swap     = arr[k][i];
          arr[k][i]   = arr[k][j];
          arr[k][j] = swap;
  
              }
          }
      }
  }
  
      printf("Ascending:\n");
      for( i = 0 ; i &lt; rows; i++){
          for( j = 0 ; j &lt; cols; j++){
  
      printf("%3d", arr[i][j]);
          }
      printf("\n");
      }
  
  getch(); 
  
  }
  </code></pre>