C#C
C#3y ago
Ronnie

✅ help with 2D arrays

using System;
using System.Collections.Generic;


namespace CSharp
{
    class Program
    {
        static void Main(string[] args)
        {       
            
           int[,] arr = { {1, 2, 3}, {4, 5, 6} };

           foreach (int i in arr){
                Console.WriteLine(arr[i]);
           }
        }
    }
}
How would i loop thorugh a 2d array and print their values instead of their index? this is hat i have so far
Was this page helpful?