10.29.2009

Program Mengunakan Repeat Antil

Tugas Teknik Tompilasi
NAMA : YUSUF ABDUL ROSYID
NIM : 06530112
TUGAS : TEKNIK KOMPILASI


Program Mengunakan Repeat Antil

program integral
uses wincrt;
var a,b,int,h;real;
integer;
b:char;
begin
repeat;
write('===== POGRAM INTERGRAL =====');
writreln;
writeln;
write('masukkan nilai a =');readln(a);
write('masukkan nilai b =');readln(b);
write('masukkan nilai n =');readln(n);

int:=0;
k:=1;
h:=(b-a)/n'
while k<=n do
begin
int:=int+exp(a+k*h)*h;
k:=k+1;
end;
writeln;
write('hasil integralnya =',int:10:3);
writeln;
write('coba lagi? y/t');
jawab:=readkey;
until jawab='t'
end.






Notasi postfixnya =

1. Int
2. 0
3. :=
4. i
5. 1
6. :=
7. h
8. b
9. a
10. –
11. n
12. /
13. k
14. n
15. >=
16. 32
17. BZ
18. int
19. int
20. a
21. k
22. h
23. h
24. *
25. +
26. *
27. k
28. k
29. 1
30. +
31. :=
32. end



0 komentar:

Posting Komentar

jangan lupa comentnya bro,,,,