Find the number of consecutive zero at the end after multiplying n numbers | Java program to find the number of consecutive zero at the end after multiplying n numbers ; Function to count two 's factor ; Count number of 2 s present in n ; Function to count five 's  factor ; Function to count number of zeros ; Count the two 's factor  of n number ; Count the five 's factor  of n number ; Return the minimum ; driver function
public class GfG { static int two_factor ( int n ) { int twocount = 0 ; while ( n % 2 == 0 ) { twocount ++ ; n = n / 2 ; } return twocount ; } static int five_factor ( int n ) { int fivecount = 0 ; while ( n % 5 == 0 ) { fivecount ++ ; n = n / 5 ; } return fivecount ; } static int find_con_zero ( int arr [ ] , int n ) { int twocount = 0 ; int fivecount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { twocount += two_factor ( arr [ i ] ) ; fivecount += five_factor ( arr [ i ] ) ; } if ( twocount < fivecount ) return twocount ; else return fivecount ; } public static void main ( String s [ ] ) { int arr [ ] = { 100 , 10 , 5 , 25 , 35 , 14 } ; int n = 6 ; System . out . println ( find_con_zero ( arr , n ) ) ; } }