My site

Site menu
Section categories
Artikel [1]
Profile [0]
Files [8]
Artikel Kampus [1]
Nilai Mata Kuliah [0]
Coretanku [4]
Turbo Pascal [3]
Software [0]
Materi SMT 2 [3]
Statistics

Total online: 1
Guests: 1
Users: 0
Main » Files » Mr. Yahya.Net » Turbo Pascal

REPEAT ... UNTIL
2009-11-30, 8:54 PM
Uses wincrt;
Var
   n, jumlah, pencacah : integer;

begin
     clrscr;
     Writeln('Menghitung jumlah 1 + 2 + 3 + ... + n');
     write('n = ? ');
     readln(n);
     pencacah:=0;
     jumlah:=0;

     repeat
           begin
                jumlah:=jumlah+pencacah;
                pencacah:=pencacah + 1;
                end;

     until pencacah = n+1;
     writeln;
     writeln('Jumlah deret = ',jumlah);
     readln;
end.

--------------------- oOo ---------------------
uses wincrt;
var
   i:integer;
begin
     clrscr;
     i:=1;
     repeat
           writeln('Yahya Oteda Net');
           i:=i+1;
           until (i>5);
     readln;
end.

--------------------- oOo ---------------------
uses wincrt;
var input,temp, temp2 : byte;
begin
     clrscr;
     write('Masukkan inputan bilangan: ');
     temp:=1;
     readln(input);
     repeat
           temp2:=1;
           repeat
                 write(temp2);
                 temp2:=temp2+1;
           until temp2>temp;
                 writeln;
                 temp:=temp+1;
     until temp>input;
     writeln('Anda tekan enter untuk keluar');
     readln;
end.

--------------------- oOo ---------------------
Uses Wincrt;
var
  kata: string;
  i,j : byte; 
begin
  kata:='YAHYAOTEDA';
  for i:=1 to length(kata) do
  begin
    for j:=1 to i do
    begin
      write(kata[j]);
    end;
    writeln;
  end;
end.

--------------------- oOo ---------------------


Category: Turbo Pascal | Added by: YahyaOteda
Views: 254 | Downloads: 0 | Rating: 0.0/0
Total comments: 0
Name *:
Email *:
Code *:
Search
Site friends
  • Create your own site
  • Tag Board

    Copyright MyCorp © 2018