Demonstrate a two-dimensional array : Array Dimension : Collections Data Structure C# Source Code


Custom Search

C# Source Code » Collections Data Structure » Array Dimension »

 

Demonstrate a two-dimensional array


  1.       
  2.   
  3. // Demonstrate a two-dimensional array.    
  4. using System;   
  5.   
  6. public class TwoD {    
  7.   public static void Main() {    
  8.     int t, i;   
  9.     int[,] table = new int[3, 4];    
  10.     
  11.     for( t = 0; t < 3; ++t) {    
  12.       for(i = 0; i < 4; ++i) {    
  13.         table[t,i] = (t*4)+i+1;    
  14.         Console.Write(table[t,i] + " ");    
  15.       }    
  16.       Console.WriteLine();   
  17.     }    
  18.   }   
  19. }  
  20.   
  21.              
  22.          
  23.       
  24.      
  25.     
  26.      


HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Collections Data Structure
» Array Dimension