RSS

Program Bagi 2 – pascal

09 Mar

contoh sintag program bagi 2 menggunakan program pascal

program bagi2;
uses wincrt;
var a, b, c, d : real;

const
epsilon1 = 0.000001; 
epsilon2 = 0.00000001;
function f(x:real):real;

begin
f:=x*x+6*x+5;
end;

begin
a := 0;
b := -1;
repeat
c:=(a+b)/2 ;
if f(a)*f(c)<0 then
b:=c
else
a:=c;
until (ABS(a-b) < epsilon1 ) or ((f(c)) < epsilon2 );
writeln ('hampiran akar =',c:10:6);
end.

 
Leave a comment

Posted by on March 9, 2013 in Home

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
CATATAN SIMET (Si Math)

SIMET DAN PERMASALAHAN MATEMATIKA-NYA

MATHE

" Math Education Blog "

KusKus FunKi Math

Ku suka, Ku senang, Fun (menyenangkan), Ku Ingat Matematika

Sebel Matematika

Senang Belajar Matematika

xy - Math

Source and Share About Mathematics

Rawa_Math

Always Think in Math

Math's Rainbow

When you can see the beauty of mathematics

METAMATIKA

matematika merangkai nusantara

%d bloggers like this: