logo

Crowdly

In program este data o functie la tema corespunzatoare. Scrieti instructiunea ce...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

In program este data o functie la tema corespunzatoare. Scrieti instructiunea ce lipseste.

#include <iostream>

#include <cmath>

#define eps 0.00000000001

#define iter 200

double f(double x) {

return x*x*x-2*x*x*cos(x)+x-3;

}

//f1 este derivata functiei f

double f1(double x) {

return 3*x*x+2*x*x*sin(x)-4*x*cos(x)+1;

}

double itang(double a) {

int i;

double x,y1,y;

i=0;

x=a;

y=f(x);

y1=f1(x);

while ( (i<=iter) && ((y<-eps) || (y>eps)) ) {

x=x-y/y1;

y=f(x);

y1=f1(x);

cout << "\n\nf(" << x << ")=" << y << " la iteratia " << i;

i++;

}

if (

Ответ Вопрос 5

) {

cout<<"Problema nu se poate rezolva in nr. maxim de iteratii";

return 0;

}

//Din cauza metodei TI-207, nu se va afisa rezultatul in caz ca radacina va fi egala cu 0.

else

return x;

}

int main() {

double x, a;

cout << "a= ";

cin >> a;

x=itang(a);

if (x!=0)

cout << '\n' << x;

return 0;

}

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle1.ceiti.md?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!