```
public class Solution {
public void MoveZeroes(int[] nums) {
bool sorted = false;
while (!sorted)
{
sorted = true;
for (int i = 0; i < nums.Length-1; i++)
{
if (nums[i] == 0 && nums[i+1] != 0)
{
sorted = false;
nums[i] = nums[i+1];
nums[i+1] = 0;
}
}
}
}
}
```