#include int main () { unsigned long n, m, this, next; printf("\nRight rotate:\n"); n = 10; this = 10; next = 100; while (this < 1000000000) { m = (n / 10) + this * (n % 10); if ((m % n == 0) && (m / n > 1)) { printf("Smallest integer is %d.\n", n); printf("Multiplier is %d.\n", m/n); break; } if (++n == next) { this *= 10; next *= 10; } } if (this == 1000000000) printf("Search failed...\n"); printf("\nLeft rotate:\n"); n = 10; this = 10; next = 100; while (this < 1000000000) { m = 10 * (n % this) + (n / this); if ((m % n == 0) && (m / n > 1)) { printf("Smallest integer is %d.\n", n); printf("Multiplier is %d.\n", m/n); break; } if (++n == next) { this *= 10; next *= 10; } } if (this == 1000000000) printf("Search failed...\n"); exit(0); }