what im really trying to do is to have this program calculate the equation i have but instead of it printing out 10 its suppose to print out 20. essentially i want it to update x every time its been used. i figured passing by reference is the way to do this but i keep getting 10. i want to solve this by without having to break the equation apart in several pieces if possible. thank you for your help and advice in advance.