come on, even of there where no min function,
you could use
if (a>b) max=a: min=b;
else max=b;min=a

you should be able to figure that out...