Question: Write a c++ program for the following question Solver Find the numerical solution of equations (c) accurate to 0.00001 Angle x specifies in degrees. NB:

Write a c++ program for the following question

Solver

Find the numerical solution of equations (c) accurate to 0.00001 Write a c++ program for the following question Solver Find the numerical

Angle x specifies in degrees.

NB: The solution should be in the form as shown in an example below:

#define _CRT_SECURE_NO_WARNINGS

#include

#include

#include

#define PI 3.1415926535897932384626433832795

double func(double x)

{

return (sin(PI*x / 180) - 1 / x);

}

double find(double x0, double x1, double eps) {

double left = x0, right = x1, x, fl, fr, f;

int iter = 0;

printf("x0= %lf x1= %lf ", x0, x1);

do {

fl = func(left); fr = func(right);

x = (left + right) / 2;

f = func(x);

if (f > 0) right = x;

else left = x;

iter++;

} while (fabs(f) > eps && iter

printf("%d ???????? ", iter);

return x;

}

int main() {

system("chcp 1251");

system("cls");

printf("%lf ", find(1.0, 10.0, 0.00001));

getchar();

return 0;

}

In (2) sin (z) + 1 S111 | .2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!