program bintang Pascal

uses wincrt;

var n, a, b : integer;

begin
      clrscr;
      write ('Masukkan angka : '); readln (n);
      for a := 1 to n do
      begin
            for b := 1 to (2*n)-a do
            begin
                  write (' ');
            end;
            for b:= 1 to (2*a)-1 do
            begin
                  write ('*');
            end;
            writeln;
      end;
      for a := 1 to n do
      begin
            for b := 1 to n-a do
            begin
                  write (' ');
            end;
            for b := 1 to a do
            begin
                  write ('*');

            end;
            for b := 1 to (2*n)-1 do
            begin
                  write (' ');
            end;
            for b := 1 to a do
            begin
                  write ('*');
            end;
            writeln;
      end;
      for a := 1 to n-1 do
      begin
            for b := 1 to a do
            begin
                  write (' ');
            end;
            for b := 1 to n-a do
            begin
                  write ('*');
            end;
            for b := 1 to (2*n)-1 do
            begin
                  write (' ');
            end;
            for b := 1 to n-a do
            begin
                  write ('*');
            end;
            writeln;
      end;
      for a := 0 to n-1 do
      begin
            for b := 1 to n+a do
            begin
                  write (' ');
            end;
            for b := 2 to (2*n)-(a*2) do
            begin
                  write ('*');
            end;
            writeln;
      end;
      readln;
end.


layout


3:29:00 PM

Post a Comment

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget