Count rotations of N which are Odd and Even | Function to count of all rotations which are odd and even ; Driver Code
< ? php function countOddRotations ( $ n ) { $ odd_count = 0 ; $ even_count = 0 ; do { $ digit = $ n % 10 ; if ( $ digit % 2 == 1 ) $ odd_count ++ ; else $ even_count ++ ; $ n = ( int ) ( $ n / 10 ) ; } while ( $ n != 0 ) ; echo " Odd = " , ▁ $ odd _ count , ▁ " " ; STRNEWLINE TABSYMBOL echo ▁ " Even = " , ▁ $ even _ count , ▁ " " } $ n = 1234 ; countOddRotations ( $ n ) ; ? >