Tenglamarni oddiy iteratsiya usulida yechishning dasturi
#include
#include
using namespace std;
float f(float x)
{
return (exp(x)-2)/10.;
}
int main(){
float x, x0, e,a,b;
int n,i;
cout<<"birinchi yaqinlashish nuqtani kiriting";
cin>>x0;
cout<<"aniqligi";
cin>>e;
cout<<"iterasiyalar soni"; cin>>n;
x=x0;
for(i=1;i<=n;i++){
a=f(x);
if(fabs(x-a)<=0) break;
x=a;
}
cout<<"iterasiyalar soni="<
cout<<"noma'lum had="<
return 0;}
Do'stlaringiz bilan baham: |