using System;
class Program
{
static void move_zeros_to_end(int[] arr) {
int j = 0, len = arr.Length;
for (int i = 0; i < len; i++)
if (arr[i] != 0)
arr[j++] = arr[i];
while (j < len)
arr[j++] = 0;
}
static void Main()
{
int[] arr = {0, 3, 4, 0, 6, 0, 0, 8, 9, 0};
move_zeros_to_end(arr);
for (int i = 0; i < arr.Length; i++)
Console.Write(arr[i] + " ");
}
}
/*
run:
3 4 6 8 9 0 0 0 0 0
*/