About 9,110,000 results
Open links in new tab
  1. How to print 2D array to console in C# - Stack Overflow

    Jun 7, 2014 · //The following are three ways to print any 2d arrays to console: int[,] twoDArray = new int[3, 4]{ {2,5,55,44},{10,45,5,22 },{ 67,34,56,77} }; Console.WriteLine("Array Code Out Method:1"); int rows = twoDArray.GetLength(0); // 0 is first dimension, 1 is 2nd //dimension of 2d array int cols = twoDArray.GetLength(1); for (int i = 0; i < rows ...

  2. c# - Printing 2D array in matrix format - Stack Overflow

    Mar 28, 2013 · I have a 2D array as follows: long[,] arr = new long[4, 4] {{ 0, 0, 0, 0 }, { 1, 1, 1, 1 }, { 0, 0, 0, 0 }, { 1, 1, 1, 1 }}; I want to print the values of this array in matrix format like: 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 How can I do this?

  3. .net - printing all contents of array in C# - Stack Overflow

    I am trying to print out the contents of an array after invoking some methods which alter it, in Java I use: System.out.print(Arrays.toString(alg.id)); how do I do this in c#?

  4. How to Print a 2D Array to the Console in C# - Code Maze

    Jun 2, 2024 · In this article, discover how to print a chessboard-style 2D array to the console in C# using nested for loops.

  5. C# Multidimensional Arrays - W3Schools

    To access an element of a two-dimensional array, you must specify two indexes: one for the array, and one for the element inside that array. Or better yet, with the table visualization in mind; one for the row and one for the column (see example below).

  6. Print a multidimensional array in C# | Techie Delight

    Oct 9, 2023 · This post will discuss how to print multidimensional arrays in C#. The foreach statement provides a simple, clean way to iterate through the elements of a multidimensional array.

  7. 2D Arrays in C# with Examples - Dot Net Tutorials

    Mar 23, 2019 · In the below example, we are creating a two-dimensional integer array with 4 Rows and 5 Columns. Then we are printing the values of the 2D Array using a for each loop to see what default it stores. Then using nested for loop, we are assigning the values to the 2D Array as well as Printing the values of the 2D Array.

  8. C# Multidimensional Arrays - GeeksforGeeks

    Jan 15, 2025 · Step 1: Declare the Multi-Dimensional Array with fixed number of rows and columns. Step 2: Iterate the elements of array position and then assigning the values to it using ReadLine () Method. Step 3: Iterate and Printing the elements of Array. Example: A 3D Array is just a complex representation of Multidimensional Array.

  9. Print 2D Array (Matrix) In C# - C# Corner

    In this blog, you will learn how to print 2D Array (Matrix) in C#.

  10. Print a 2-D Array or Matrix in C# - Online Tutorials Library

    Learn how to print a 2-D array or matrix in C# with this comprehensive guide, including examples and best practices.

  11. Some results have been removed
Refresh