/* * calcworld.c : main program for some basic calculations */ #include #include "mymath.h" int main(void) { int aa, bb; float avrg, div; int prod, pow, rem; do { printf("This program calculates the average, product, division"); printf(", power, and remainder of two numbers.\n"); printf("Enter two integers separated by spaces: "); scanf("%d%d", &aa, &bb); getchar(); avrg=int_average(aa,bb); printf("\nThe average is %.2f.\n", avrg); prod=int_product(aa,bb); printf("The product is %d.\n", prod); div=int_division(aa,bb); printf("The number %d divided by %d is %.2f.\n", aa, bb, div); pow=int_power(aa,bb); printf("The number %d raised to the power of %d is %d.\n", aa, bb, pow); rem=int_remainder(aa,bb); printf("The remainder of %d divided by %d is %d.\n", aa, bb, rem); } while( get_answer() ); return 0; }