Minggu, 09 Desember 2012

Mencetak bintang

Mencetak Bintang Secara ascending

uses wincrt;
var
a,c,n:integer;
begin
write('N : ');readln(n);
 for a:= 1 to n do
 begin
  for c:= 1 to a do
  write('*');
  writeln;
 end;
end.


Mencetak Bintang Secara descending

uses wincrt;
var
a,c,n:integer;
begin
write('N : ');readln(n);
 for a:= n downto 1 do
 begin
  for c:= a downto 1 do
  write('*');
  writeln;
 end;
end.


Mencetak Bintang rata kiri kanan


uses wincrt;
var
a,c,n:integer;
begin
write('N : ');readln(n);
 for a:= 1 to n do
 begin
  for c:= 1 to n do
  write('*');
  writeln;
 end;
end.

Tidak ada komentar:

Posting Komentar

array data mahasiswa

program array_1Dimensi; uses  winCrt; var  nim,nm,smstr,mk,grade:array[1..4] of string;  nh,uts,uas:array[1..4] of integer;  na:array...