Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">int main() { double a = 2, b = 4, x, epsilon = pow(10.0, -7); while (fabs(b - a) > epsilon) { x = (a + b) / 2; if (sin(a) * sin(x) < 0) b = x; else if (sin(b) * sin(x) < 0) a = x; } cout << "x = "<< x << " a = " << a << " b =  " << b << "\n"; cin.get(); return 0; }</span> int main () {double a 2, b = = 4, x, epsilon = pow (10,0, -7); while (fabs (b - a) epsilon>) {x = (a + b) / 2; if ( dosa (a) * sin (x) <0) b = x; else if (sin (b) * sin (x) <0) a = x;} cout <<"x =" <<x <<"a = "<<a <<" b = "<<b <<" \ n "; cin.get (); return 0;}</span>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement