Iteration Method

Iteration Method :

ALGORITHM :

  1.  Read x0, e, n
  2. (x0 is the initial guess, e is the allowed error in root, n is total iterations to be performed)
  3.  x1 ← g(x0)
  4. for i = 1 to n in steps of 1 do
    x0 ← x1
    x1 ← g(x0)
  5.  If (x1-x0)/x1 ≤ e then, GOTO 9
    [end for loop]
  6. Print‘Does not converge to a root’, x0, x1
  7. Stop
  8. Print ‘converges to a root’, i, x1
  9. [END]

C SOURCE CODE :


 OUTPUT

Leave a Reply

Your email address will not be published. Required fields are marked *