I know that ive got to use for loops but dunno where.have u got any idea?

I see no reason why you'd need loops, you have 3 variable to find (x, y and z) and 3 equations.

That makes it a simultaneous equation which does not require loops, you just need to slog you way through the algebra.

So do you know how to solve simultaneous equations? If you can solve a simple version of your problem on paper you will find it hard to make the computer do it for you so if not read these.

http://www.gcseguide.co.uk/simultaneous_equations.htm http://www.allaboutcircuits.com/vol_5/chpt_4/14.html
Once you know how to solve a simultaneous equation on paper then you can think about writing a generaic solution that you computer will be able to use to solve any set of 3 equations (assuming that there is a solution).