Johnny Johnny - 14 days ago 4
C# Question

How to extract specific column from 2D array

Updated please review ,r ohin's answer ty

Answer
    var column = 2; // your expected column
    //if it needs to be dynamic, you can read it from user entry
    // Console.Write("Enter expected column: ");
    // column = int.Parse(Console.ReadLine()); //enhance with error checks
    for (int row = 0; row < r; row++)
    {
        Console.Write(matrix[row, column] + " ");
    }