Arduino multiplication problem

So, I've been trying to write a program for the accelerometer sensor to get the vector magnitude based on the x,y and z values. However, the output of the multiplication part doesn't seem right at all. It always shows the wrong value for the vlength, which is way smaller than the actual value. Is there anything wrong with my code?

int arr[3] = {0,0,0};

void setup() {
  Serial.begin(9600);
}

void loop() {
readXYZ();
magnitude();
}

int readXYZ(){
  arr[0] = analogRead(A0);
  arr[1] = analogRead(A1);
  arr[2] = analogRead(A2);
  delay(100);
  Serial.print("x: ");
  Serial.print(arr[0]);
  Serial.print(" y: ");
  Serial.print(arr[1]);
  Serial.print(" z:");
  Serial.print(arr[2]);
}

int magnitude(){
  long vlength = sqrt(sq(arr[0])+sq(arr[1])+sq(arr[2]));
  Serial.print(" m:");
  Serial.println(vlength);
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

When you have a problem like that you should break up a complex calculation into separate pieces so you can print the intermediate values.

As you are using an integer array I suspect you are suffering from overflow. Try changing its datatype to long.

...R