title: Printing elements under second diagonal in 2d Matrix in C
body: <p>Hello I have a code that shows the elements under the main diagonal of 2d matrix and I need to also show the elements under the second diagonal. any ideas what to manipulate in the loop.</p>
  
  <pre><code>// loop to show the elements under the main diagonal
  void element_under_diag(int number, int arr[number][number])
  {
     int i, j;
  
     printf("\nUnder the main diagonal:\n");
        for(i=0;i&lt;number;i++){
           for(j=0;j&lt;number;j++){
              if(i&gt;j)
                 printf("%d ",arr[i][j]);
           }
        }
     printf("\n");
  
  }
  
  </code></pre>
  
  <p><code>number</code> is taken from the user in the main function and it's the number of row and columns in the matrix.</p>
  
  <p>this loop result into an output like this: </p>
  
  <pre><code>The entered matrix is:
  1 2 3
  4 5 6
  7 8 9
  Under the main diagonal:
  4 7 8
  </code></pre>
  
  <p>Now I need the output to be something like this:</p>
  
  <pre><code>The entered matrix is:
  1 2 3
  4 5 6
  7 8 9
  Under the secondary diagonal:
  6 8 9
  </code></pre>