#include <iostream.h>
#include <math.h>
#include<conio.h>
const double acc = 0.00000000001;
float r1, r, er;
inline float s(float x)
{
return (x * x + 2 * x + 1);
}
inline float ds(float x)
{
return (2 * x + 2);
}
void main()
{ clrscr();
cout<<"Enter the initial value of root ";
cin>>r;
er = 2;
while(er>acc)
{
if(ds(r) == 0)
goto l1;
r1 = r - (s(r)/ds(r));
er = fabs(r - r1);
r = r1;
}
l1:
cout<<" A real root is "<<r<<"\n";
getch();
}