Sabtu, 14 Juli 2012

DERET HITUNG:Kelipatan tiga

uses crt;
var
a,i,n:integer;
pil:char;
begin
clrscr;
write('program penghitungan deret hitung,silahkan klik enter:');readln;
writeln;
writeln;
write('Msukkan suku pertama:'); readln(n);
a:=3;
for i:=1 to n do
begin
write(a);
write('');
a:=a+3;
write('.........)
end;
readln;
write('Hitung lagi[Y/T]?'); readln(pil);
case(pil)of
'Y':begin
write('Msukkan suku ke:'); readln(n);
a:=3;
for i:=1 to n do
begin
write(a);
write('');
a:=a+2;
end;
readln;
end;
'T':begin
write('Thanks'); readln;
end;
end;
readln;
end.

http://layla-innocent.blogspot.com

Tidak ada komentar: