Skip to content

Instantly share code, notes, and snippets.

@chandermani
Last active May 1, 2020 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chandermani/caa2b4c8550ef6df30c58054f235dffb to your computer and use it in GitHub Desktop.
Save chandermani/caa2b4c8550ef6df30c58054f235dffb to your computer and use it in GitHub Desktop.
private void PrintMatrix(int[][] matrix){
for(int i=0;i<matrix.Length;i++) {
for(int j=0;j<matrix[0].Length;j++) {
Console.Write(matrix[i][j] + " ");
}
Console.WriteLine("");
}
}
private void PrintMatrix(int[,] matrix){
for(int i=0;i<matrix.GetLength(0);i++) {
for(int j=0;j<matrix.GetLength(1);j++) {
Console.Write(matrix[i,j] + " ");
}
Console.WriteLine("");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment