Given an integer array with zeros (0’s) and we have to move all zeros at the end of the array using java program.
Example:
Input array: 5, 1, 6, 0, 0, 3, 9, 0, 6, 7, 8, 12, 10, 0, 2
After moving 0 at the end
Output array: 5, 1, 6, 3, 9, 6, 7, 8, 12, 10, 2, 0, 0, 0, 0
Program to move zeros at the end of the array in java
Output