title: Insert the element diagonally in c program
body: <p>What is the procedure to insert the element diagonally?</p>
  
  <p>A function will take matrix.</p>
  
  <p>Examples</p>
  
  <ol>
  <li><code>a[1,2,3]</code>;</li>
  </ol>
  
  <p>This will give the following output</p>
  
  <pre><code>1 0 0 
  0 2 0
  0 0 3
  </code></pre>
  
  <ol start="2">
  <li>Similarly, <code>b[1,2,3,4,5,6]</code> should give:</li>
  </ol>
  
  <pre class="lang-or-tag-here prettyprint-override"><code>1 0 0 0 0 0
  0 2 0 0 0 0
  0 0 3 0 0 0
  0 0 0 4 0 0
  0 0 0 0 5 0
  0 0 0 0 0 6
  </code></pre>