int number, right_digit; number = 15292; if ( number ==0 ) { printf("0"); } else while ( number != 0 ) { right_digit = number % 10; printf("%i", right_digit); number /= 10; }