public static void Main()
int[,] array = new int[,]
static void MoveZero(int[,] array)
int rows = array.GetLength(0);
int cols = array.GetLength(1);
int[,] newArray = new int[rows, cols];
for (var row = 0; row < rows; row++)
for (var col = 0; col < cols; col++)
if (array[row, col] == 0)
newArray[newRow, newCol] = array[row, col];
newCol = (newCol + 1) % cols;
static void Display(int[,] array)
for (var row = 0; row < array.GetLength(0); row++)
for (var col = 0; col < array.GetLength(1); col++)
Console.Write(array[row, col].ToString().PadLeft(4));