EASILY REMOVE ZEROS FROM ANY NUMBER IN JAVA
USE THE .LENGTH PROCESS HERE
import java.util.*;
public class remove_zero
{
void main()
{
Scanner ob=new Scanner(System.in);
int a[]= new int[6],i;
System.out.println("Enter the elements");
for(i=0;i<6;i++)
{
a[i]=ob.nextInt();
}
int j=0;
for( i=0;i<a.length;i++)
{
if(a[i]!=0)
{
a[j]=a[i];
j++;
}
}
System.out.println("The elements are");
for( i=0;i<j;i++)
System.out.println(a[i]);
}
}