Q:

to find out big factorial n count the number of zeros at the end

this is my java code :
import java.util.Scanner;  
import java.math.*;
abstract class ccFctrl {        
    public static long countZero(BigInteger a){
        long noOfZero=0;
        long b;
        do{
            b =noOfZero;
            if(a.remainder(BigInteger.TEN)==BigInteger.ZERO){
                noOfZero++;
            }
            a.divide(BigInteger.TEN);   
        }while((noOfZero!=0)&&(noOfZero!=b));
        return noOfZero;
    }    
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner s=new Scanner(System.in);
        int numOfFctrlsToCalculat=s.nextInt();
        BigInteger fctrl=new BigInteger("1");
        BigInteger inc=new BigInteger("1");
        int num;
        long[] count=new long[numOfFctrlsToCalculat];
        System.out.println();
        for(int i=0;i<numOfFctrlsToCalculat;i++){
            num=s.nextInt();
            for(int j=1;j<=num;j++){
                fctrl=fctrl.multiply(inc);
                inc=inc.add(BigInteger.ONE);
            }
            inc=BigInteger.ONE;
            count[i]=countZero(fctrl);
            System.out.println();                   
        }
        for(int i=0;i<numOfFctrlsToCalculat;i++){
            System.out.println(count[i]);
        }
        s.close();  
    }
}

IDE on compiler is constantly showing me error. just can't get why code is not running

A:

Two things:

You are going into infinite loop in your method countZero. Remember BigInteger is immutable, so doing operation on the same, you should reassign the value like:
a = a.divide(BigInteger.TEN);

Your condition will never get satisfied because of above and hence will lead to infinite loop. You should check for below condition:
} while (!a.equals(BigInteger.ZERO));

Note Aside: Any reason for defining your class as abstract?

