Count rotations which are divisible by 10 | Java implementation to find the count of rotations which are divisible by 10 ; Function to return the count of all rotations which are divisible by 10. ; Loop to iterate through the number ; If the last digit is 0 , then increment the count ; Driver code
class GFG { static int countRotation ( int n ) { int count = 0 ; do { int digit = n % 10 ; if ( digit == 0 ) count ++ ; n = n / 10 ; } while ( n != 0 ) ; return count ; } public static void main ( String [ ] args ) { int n = 10203 ; System . out . println ( countRotation ( n ) ) ; } }