Sabtu, 08 Oktober 2011

0 Metode Iterasi


#include
#include
#include

float g(double x){
return ((x*x + 8) / 6);
}

void garis(){
for (int a = 1; a<= 70;a++)
cout<<"=";
}

void main(){
double xo, xn, gx, e, selisih, k=0;
garis();
cout<<"\nPROGRAM MENCARI SOLUSI METODE NUMERIK \nDENGAN METODE ITERASI\n";
garis();
cout<<"\n\n\nPersamaan Kuadrat Yang Dipakai g(x): ((x*x + 8) / 6)";
cout<<"\nMasukkan Nilai Xo : "; cin>>xo;
cout<<"Masukkan Nilai Error : "; cin>>e;
xn=xo;
cout<<"\nNO  xn\t  gx\t |xn-g(xn|<=e\n" ;
garis();
do{
k=k+1;
cout<<"\n"<
cout<<" "<<
gx=g(xn);
cout<<"\t"<<
selisih = xn-gx;
if(fabs(selisih)<= e){
cout<<"\t    Sudah\n";
garis();
cout<<"\nMaka Solusinya Adalah  "<
}
else if (fabs(selisih)>= e){
xn =gx;
cout<<"\t    Belum";
}
}while (fabs(selisih)>= e);
}

About the Author

I'm Author description here. Go to Blogger edit html and find these sentences. Now replace these sentences with your own descriptions. Subscribe to Our Feed and Follow Me on Twitter My user

    Other Recommended Posts

0 komentar:

Posting Komentar

 
back to top