Anything above

Hello, I am currently working with a project and I am stuck.

I'll give an example so you guys understand.

Let's say I have 3 variabels, X, Y and Z.

If X equals 45 and Y equals 30

Can I make it so that if X + Y > 60, anything above 60 will go into the third variabel Z, so Z automatically gets the value 15, and anything that is or below 60 will go into X?
if(X+Y>60)
Z=X+Y-60;
else
X=60-X-Y;
Thank you so much! :D
Topic archived. No new replies allowed.