Latihan Repeat Until

program latihan_repeat_until;

uses wincrt;

var

x,x2,x3:integer;

begin

write(‘masukkan bilangan fakatorial :’);readln(x3);

if x3>=1 then

begin

x:=1;

x2:=1;

repeat

begin

write(x,’+’);

x:=x+1;

x2:=x2+x;

end;

until x>x3-1;

write(x3,’=’,x2);

end;

if x3<1 then

begin

writeln;

write(‘data yang anda masukkan salah.’);

end;

end.

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

w

Connecting to %s

%d blogger menyukai ini: