Information Technology Articles :: SEO Tips :: WAP Articles :: Search Engine Marketing :: Internet Tips

Goedangilmu

Source Code Metode Titik Tengah

Posted on May 9th, 2007 in Programming, 169 views

Berikut ini merupakan source code Metode Titik Tengah yang saya buat menggunakan Delphi.

var
n,i:integer;
b,a,h,x,c,fx,l,jumlah:real;
begin
b:=2;
a:=1;
n:=4;

h:=(b-a)/n;

jumlah:=0;
for i:=1 to n do
begin
x:=(a+(a+h))/2;
c:=(a+h);

fx:=x*x;

l:=h*fx;
jumlah:=jumlah+l;

a:=c;

memo1.Lines.add(inttostr(i) + chr(vk_tab) + floattostr(fx) + chr(vk_tab) + floattostr(l));
end;
edit1.Text:=floattostr(jumlah);
end;

Related Posts :

Published by Adith

No Comments

Leave a comment