title: Why isn't my function working, i need to make a distance calculator
body: <p>Distance calculator, everything works until the program reaches the function, than the program just stops running. I tried removing the <code>void</code> and <code>int</code>s from the line I call the function in the main function but still nothing.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  
  void distanceFunc(int x2, int x1, int y2, int y1, int distance);
  
  int main ()
  {
      int action = 0;
      int x1 = 0;
      int y1 = 0;
      int x2 = 0;
      int y2 = 0;
      int distance = 0;
      printf("Welcome to my calculator!\n");
      printf("1 - Calc distance between 2 points\n");
      printf("2 - Calc hypotenuse of triangle\n");
      printf("3 - Calc area and perimeter of circle\n");
      printf("4 - Calc area of rectangle\n");
      printf("5 - Calc are of square\n");
      printf("6 - Exit\n");
      scanf("%d", &amp;action);
      if (action == 1)
      {
          printf("Enter point1 coordinates: ");
          scanf("%d %d", &amp;x1, &amp;y1);
          printf("Enter point2 coordinates: ");
          scanf("%d %d", &amp;x2, &amp;y2);
          void distanceFunc(int x2, int x1, int y2, int y1, int distance);
      }
      return 0;
  }
  
  
  void distanceFunc(int x2, int x1, int y2, int y1, int distance)
  {
      distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
      printf("Distance is %f\n", distance);
  }
  </code></pre>