title: How to make a multidimensional array using while loop in C#
body: <p>I'm a beginner in c# and I have to write a multidimensional array using while loop. I just can't go through it. So far I have made what I exactly need with nested for loop but can't convert it to while loop. Any help would be greatly appreciated.</p>
  
  <pre><code>int[][] tab = new int[4][];
  tab[0] = new int[4];
  tab[1] = new int[3];
  tab[2] = new int[2];
  tab[3] = new int[1];
  
  int num = 1;
  
  for(int i = 0; i &lt; tab.Length; i++)
  {
      for(int j = 0; j &lt; tab[i].Length; j++)
      {
          tab[i][j] = num++;
      }
  }
  
  for(int i = 0; i &lt; tab.Length; i++)
  {
      Console.Write("tab[{0}] = ", i);
      for(int j = 0; j &lt; tab[i].Length; j++)
      {
          Console.Write("{0} ", tab[i][j]);
      }
      Console.WriteLine(""); 
  }
  </code></pre>