This code doesn't crash, but something is wrong

What is wrong with this code? I’ve went through it and I can’t find the problem. z should theoretically equal .5, but in the end equals zero? I don’t know.

Here is the code:

#pragma strict

var x: int = 0;
var y: int = 0;
var z: int = 0;

function Start () {

	for(var i: int = 0; i<10; i++)
	{
		x++;
		y += 2;
		
		z = x / y;
		print(z);
	}


}

function Update () {

}

The problem is that you are using integers not floats. At the end of this loop, x = 10 and y = 20. 10 / 20 in integer math is 0 (integers cannot represent 0.5).