Senin, 27 Desember 2010

Ni source codenya :

program membuat_bintang;

uses wincrt;

var a, b, n, c : integer;

    lanjut:char;


begin
repeat
clrscr;
writeln('***************************');
writeln('*      Kelompok 10        *');
writeln('*  Algoritma Pemrograman  *');
writeln('***************************');
    write ('Masukkan angka  : '); readln (n);
    writeln;
    writeln('Hasilnya : ');
    writeln;
    if n mod 2 = 0 then
    n:=n+1
    else
    n:=n+0;
    for a := 1 to n do
    begin
        write ('*');

    end;
    writeln;
            for b := 1 to n-1 do
            begin
                 for
                 c := 1 to (n div 2) do
            begin      
            write (' ');

    end;
        writeln ('*');

    end;

writeln('');
write('Ulangi (Y/T) ? : ');readln(lanjut);
until (lanjut='t')or(lanjut='T');
donewincrt;

   
end.


Ni gambar running programnya :

Categories:

2 komentar: