My program initially asks the user to input 3 values, x1, x2 and x3.
These get fed into a mathematical equation and come out of it the other side slightly altered.
The program then prints to screen the new values of x1, x2, and x3.
These x values must go through the equation many times, so i placed them into the equation in a loop.
if(i>0; i=100; i++)
This gave me 100 values of x1, x2, and x3 and printed them to screen, which is fine.
However, I would like to do a while loop. I would like the program to stop when the values of x1, x2, and x3 aren't changing by more than 0.0001 every time.
I thought something like:
while (x1 - x1 > 0.0001){ DO EQUATION }
But of course, this wont work. Also, I want it so it's is not only x1 that isnt changing by 0.0001 any more, it must once all of the x values have stopped changing by 0.0001.
Does anybody have any ideas?