title: How do I create a shrink function that would divide the input by 2?
body: <p>Using this code below, how would I create a shrink function that divides the input by 2? I'm pretty new to this stuff, so I've tried doing things like float shrink(a/2) with no luck. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void printHelp () {
   printf ("\n");
   printf ("a: a(x) = x*x\n");
   printf ("b: b(x) = x*x*x\n");
   printf ("c: c(x) = x^2 + 2*x + 7\n");
   printf ("q: quit\n");
  }
  
  void a(float x) {
  float v = x*x;
  printf (" a(%.2f) = %.2f^2 = %.2f\n", x, x, v);
  } // end function a
  void b(float x) {
  float v = x*x*x;
   printf (" a(%.2f) = %.2f^3 = %.2f\n", x, x, v);
  } // end function b
  void c(float x) {
   float v = x*x + 2*x + 7;
   printf (" c(%.2f) = %.2f^2 + 2*%.2f + 7 = %.2f\n",
   x, x, x, v);
  } // end function c
  int menu () {
   char selection;
   float x;
   printHelp ();
   scanf ("%s", &amp;selection);
   if (selection == 'q') return 1;
   scanf ("%f", &amp;x);
   if (selection == 'a') a(x);
   if (selection == 'b') b(x);
   if (selection == 'c') c(x);
   return 0;
  } // end function menu
  int main() {
   while (menu() == 0);
   printf ("... bye ...\n");
   return 0;
  } // end main
  </code></pre>