title: Vector Cross product in C
body: <p>I am trying to write a code to solve the cross product of two 3D vectors. I need to be able to input the X,Y,Z values of the vector and then have it output the cross product of the two vectors. When I run the program it returns a value of zero. Any help is appreciated thanks!</p>
  
  <pre><code>   #include &lt;stdio.h&gt;
     #include &lt;stdlib.h&gt;
  
     int a,b,c;
     int x,y,z;
     int A[3],B[3];
     int sum = 0;
     int i;
  
    void vector_product(int A[i], int B[i])
   {
    sum += ((b*z)-(c*y))+((a*z)-(c*x))+((a*y)-(b*x));
   }
  
  int main(void)
  {
  
    for(i=0;i&lt;3;i++)
   {
      scanf("%d",&amp;A[i]);
   }
   for(i=0;i&lt;3;i++)
    {
      scanf("%d",&amp;B[i]);
    }
  
      int A[3] = {a, b, c};
      int B[3] = {x, y, z};
      vector_product(A,B);
      printf("%d\n",sum);
  
      return sum;
  }
  </code></pre>