#include /* */ /* main program for axbm.c */ /* solves congruences a * x = b mod m */ /* */ main() { long a, b, m, x; long axbm(); while ( 1L == 1L) { printf("\n"); printf("Congruence solver of a * x = b (mod m)\n"); printf("Enter a, b, and m: "); scanf("%ld %ld %ld", &a, &b, &m); x = axbm(a, b, m); if(x >= 0L) { printf("Congruence solved:\n"); printf("\t%ld * %ld = %ld (mod %ld)\n", a, x, b, m); } else printf("Congruence unsolvable\n"); } }