program for3;
uses wincrt;
var n,c,d:integer;
sisa,x,a:real;
begin
write ('masukan jarak = '); readln(x);
write ('langkah awal='); readln(a);
n:=0;
x:=x*100;
repeat
begin
if n>=21 then
begin
a:=a-(a*0.1);
n:=0
end
else if n<21 then
while n<20 do
begin
x:=x-(x*0.1);
writeln ('sisa jarak=',x:2:2);
n:=n+1;
end;
end;
until x<=a;
end.
Belum ada tanggapan untuk "pemrograman dasar "
Post a Comment