/* * funcint3B.c */ #include #include "mymath.h" ///////////////////////////////////////// // get an answer int get_answer(void) { char cc; printf("\nPress 'q' to quit, any other key to continue!: "); cc=getchar(); if(cc=='q') { return 0; } else { return 1; } } ///////////////////////////////////////// // average of two integers float int_average(int xx, int yy) { return(xx+yy)/2.0; } ///////////////////////////////////////// // divide int xx by int yy float int_division(int xx, int yy) { return ( (float)xx/yy ); } ///////////////////////////////////////// // multiply two integers int int_product(int xx, int yy) { return(xx*yy); } ///////////////////////////////////////// // int xx raised to the power of yy int int_power(int xx, int yy) { int ii; int pp=1; for(ii=0; ii=yy) { xx=xx-yy; } return xx; } } ///////////////////////////////////////// // SelfTest2 Problems 3a. char tranq(char cc) { if ( cc == '?' ) { return ' '; } else { return cc; } } ///////////////////////////////////////// // Selftest2 Problem 3b. int maxnum(int xx, int yy,int zz) { int the_max; if ( xx > yy ) the_max=xx; else the_max=yy; if( zz > the_max ) the_max=zz; return the_max; }