Try it, test it, see if it works. Spoiler, it doesn't.
First, you are setting y equal to min or x equal to max, as examples, you should be setting max equal to the value of x. Next, neither min nor max are initialized to any value, so when you use them for comparison it doesn't work. Your logic is also bad. I would suggest something along the lines of:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//min
min = x;
if (min > y)
min = y;
if (min > z)
min = z;
//max
max = x;
if (max < y)
max = y;
if (max < z)
max = z;