thanks
that last reply helped me figure out what i was doing wrong
I put the equation, x1= (x0+(y/x0))/2 outside of the loop
and put x0 = x1 inside the loop along with x1= (x0+(y/x0))/2 and it worked
x0 = (y/4);
x1 = ((x0 + (y/x0))/2);
while (!( x1 - x0 <= 0.0001 && x1 - x0...
phinds,
I changed x0 == x1 to x0 = x1 instead
This stopped the infinite loop, but it shows x1 and x0 as the same value.The loop still isn't updating x1 and x0. Is there something I'm missing, what's wrong with my source code.
I'm new to programming. my assignment wants me to create a program using c++ that can find the square root of any number using Newtons Method.
The user has to enter a number (y) and the program has to calculate the root and has to show each iteration. the initial guess (x0) has to be y/4...