C# Multidimensional ArraysThe multidimensional array is also known as rectangular arrays in C#. It can be two dimensional or three dimensional. The data is stored in tabular form (row * column) which is also known as matrix. To create multidimensional array, we need to use comma inside the square brackets. For example: C# Multidimensional Array ExampleLet's see a simple example of multidimensional array in C# which declares, initializes and traverse two dimensional array. Output: 0 10 0 0 0 20 30 0 0 C# Multidimensional Array Example: Declaration and initialization at same timeThere are 3 ways to initialize multidimensional array in C# while declaration. We can omit the array size. We can omit the new operator also. Let's see a simple example of multidimensional array which initializes array at the time of declaration. Output: 1 2 3 4 5 6 7 8 9 Next TopicC# Jagged Arrays |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India