Tulis aja dulu, siapa tahu orang lain butuh :-)

PROGRAM BELAH KETUPAT ANGKA


PROGRAM BELAH_KETUPAT;
uses wincrt;

var
N,i,j,k : integer;
begin
writeln('----- PROGRAM BELAH KETUPAT ANGKA ----');
writeln;
write ('Masukkan Batas : ');readln(N);
writeln;
begin
for i := 1 to N do
begin
    for k := (N-1) downto i do
        begin
        write ('  ');
        end;

    for j:= 1 to i do
        begin    
        write(j,' ');
        end;
        begin
    for j:=(i-1) downto 1 do
         write(j,' ');
        end;
writeln(' ');
end;
begin
for i := (N-1) downto 1 do
begin
    for k := (N-1) downto i do
        begin
        write ('  ');
        end;
   
    for j := i downto 1 do
        begin
        write (j,' ');
        end;
        begin
    for j := 1 to (i-1) do
        write(j,' ');
        end;     
   writeln(' ');
end;
end;
end;
end.

==========================================>>

RUNNING PROGRAM:

Share:

2 comments:

  1. bro

    begin
    for b := 1 to (a-1) do
    write(b,' ');
    end;

    sama

    for j := 1 to (i-1) do
    write(j,' ');
    end;


    kayaknnya kebalik deh for dalam for nomor 2 dan 3 yang bawah itu

    ReplyDelete
    Replies
    1. maap. belum q setting lagi. hehehehehe. mkasih.

      Delete

ARCHIEV

VISITORS

free counters

FRIENDS

Blog Archive