Following three lines generate the next circular permutation of a number . We move last digit to first position .
int rem = num % 10 ; int div = num / 10 ; num = ( pow ( 10 , count - 1 ) ) * rem + div ;