title: Is Multiplication and Division of Pointers allowed in C?
body: <p>I remember my programming prof said that multiplication and division of pointers are not allowed. We have a seatwork that needs us to create a program that adds, subtracts, multiplies and divides two numbers using pointers.  </p>
  
  <p>This is my code in the main function:</p>
  
  <pre><code>float num1, num2, a, b, c, d;
  
  printf("Enter a number: ");
  scanf("%f", &amp;num1);
  printf("Enter another number: ");
  scanf("%f", &amp;num2);
  
  a = add(&amp;num1, &amp;num2);
  b = subtract(&amp;num1, &amp;num2);
  c = multiply(&amp;num1, &amp;num2);
  d = divide(&amp;num1, &amp;num2);
  
  printf("Sum: %.2f\nDifference: %.2f\nProduct: %.2f\nQuotient: %.2f", a, b, c, d);
  getch();
  return 0;
  </code></pre>
  
  <p>This is my code for the add, subtract, multiply, and divide functions:</p>
  
  <pre><code>float add(float *x, float *y)
  {
      return *x+*y;
  }
  float subtract(float *x, float *y)
  {
      return *x-*y;
  }
  float multiply(float *x, float *y)
  {
      return *x * *y;
  }
  float divide(float *x, float *y)
  {
      return *x / *y;
  }
  </code></pre>
  
  <p>My code runs and works but is it allowed?</p>