title: Why doesn't this loop work for finding the Euclid sum of vectors?
body: <p>I am trying to find the Euclidian sum of two vectors (vector1, vector2) that I have already entered into the program. I am trying to do this with a while loop, but for some reason it won't produce the correct result. Would someone be able to show me where I am going wrong with my code? Thank you so much. </p>
  
  <pre><code>i = 1;
  int sum = 0;
  while (i &lt;= n - 1) {
  sum = sqrt((vector1[i] - vector2[i])^2);
  i++;
  }
  
  
  
  
  printf("%d", sum);
  </code></pre>