copy program dibawah ini terus paste di program pascal dan jalankan untuk mencari akar-akar persamaan. anda bisa mengganti kode sesuai kebutuhan anda.

PROGRAM SECANT;
USES CRT;
FUNCTION F(X:REAL):REAL;
BEGIN
F:=X*X*X-X*X-8;
END;
VAR E,X0,X1,X2,M : REAL;
X :INTEGER;
BEGIN
CLRSCR;
writeln;
writeln(‘ http://www.slem.co.cc; ‘ );
writeln(‘ ************************************************************’);
writeln(‘ Mencari akar x*x*x-x*x-8 = 0 dengan nilai awal x0=2 dan x1=3’);
writeln(‘ Menggunakan Metode Secant’);
writeln(‘ Dengan nilai galat akar = 0.00001’);
writeln(‘ ************************************************************’);
writeln;
write(‘ Masukkan nilai X0= ‘);readln(X0);
write(‘ Masukkan nilai X1= ‘);readln(X1);
writeln;
WRITELN(‘ =======================================’);
writeln(‘ i taksiran-akar xi nilai |f(xi)|’);
WRITELN(‘ =======================================’);
E:=0.00001;
x1:=3;
X:=0;
REPEAT
X2:=X1-F(X1)*(X1-X0)/(F(X1)-F(X0));
M:=ABS((X2-X1)/X2);
X0:=X1;
X1:=X2;
X:=X+1;
writeln(‘ ‘,X,’ ‘ ,X2:0:7, ‘ ‘,abs(f(x2)):0:7);
UNTIL M < E;
writeln(' =======================================');
writeln;
writeln(' Jadi, hampiran akarnya: ',X2:0:7);
READLN;
END.
atau DOWNLOAD CODEnya DISINI