http://www.cs.wisc.edu/~milo/cs302/quiz2-sol.html
#include<iostream.h> void height(int total_inches, int& inches, int& feet); int main() { int my_height = 78; int height_inches, height_feet; height(my_height, height_inches, height_feet); cout << "I am " << height_feet << " feet, "; cout << height_inches << " inches tall." << endl; } void height(int total_inches, int& inches, int& feet) { inches = total_inches % 12; feet = total_inches / 12; }
void add_tax(int tax_rate, int& cost) { cost = (1.0 + tax_rate) * cost; }