#include #include #include void pause (void) { cout << "Hit any key to continue..."; getch (); } void main (void) { double D, G, X, radius, half_gap; cout << "Please enter D and G (in inches): "; cin >> D >> G; // a couple of useful quantities... radius = D / 2; half_gap = G / 2; // with these quantities, the formula is short and sweet... X = radius - sqrt((radius * radius) - (half_gap * half_gap)); cout << "The wheel will drop " << X << " inches." << endl; // pause (); }