DUNIA HAMPA SEKALI

♥ 1212~mnLnysm

looping segitiga bintang

niihh,, bwad anag TI yg punya tugas membuat segitiga bintang menggunakan bahasa pemrograman pascal,, quu ingin berbagi sebuah program.. niy listing programnya :

program SegitigaBintang;
uses crt;
var
baris,kolom,jumbaris : integer;
begin
clrscr;
write(‘jumlan baris : ‘);readln(jumbaris);
writeln;
baris := 1;
while baris <= jumbaris do
begin
write(‘*’ : jumbaris + 1 – baris);
kolom := 2;
while kolom <= (2 * baris – 1) do
begin
write(‘*’);
kolom := kolom + 1;
end;
writeln;
baris := baris + 1;
end;
readln;
end.

pada program ini nantinya akan meminta berapa baris bintang yang akan di bwad…

outputnya seperti ini.. misalnya yang diinput 4 baris

. jumlah baris : 4

.     *
.   ***
.  *****
. *******

itu dulu,, nntikan program selanjudnya…

January 3, 2010 - Posted by | pascal

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: