Senin, 03 Desember 2012

Uncounteed Loop

REPEAT ..


uses
 winCrt;
var
 a,b,c:byte;
 coba:char;
begin
 coba:='Y';
 repeat
  writeln('Program Repeat Uncounted loop');
  writeln('-----------------------------');
  writeln('Masukkan Data !!');
  write('Nilai a : ');readln(a);
  write('Nilai b : ');readln(b);
  c:=a*b;
  writeln;
  writeln('Nilai c : ',c);
  write('Mau Coba Lagi?[Y/T] : ');readln(coba);
  clrscr;
 until (coba ='T') or (coba ='t');
  writeln('TERIMA KASIH');
end.

WHILE..

uses
 winCrt;
var
 a,b,c:byte;
 coba:char;
begin
 coba:='Y';
while (coba='Y') or (coba='y') do
begin
  writeln('Program Repeat Uncounted loop');
  writeln('-----------------------------');
  writeln('Masukkan Data !!');
  write('Nilai a : ');readln(a);
  write('Nilai b : ');readln(b);
  c:=a*b;
  writeln;
  writeln('Nilai c : ',c);
  write('Mau Coba Lagi?[Y/T] : ');readln(coba);
  clrscr;
 end;
  writeln('TERIMA KASIH');
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...