Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

1.

***********Assesment menengah for*****************


declare
i number:=1;
begin
while(i<=100)
loop
if (mod(i,2)=0 and mod(i,3)=0 and mod(i,4)=0) then
dbms_output.put(i||',');
elsif
(mod(i,2)=0 and mod(i,3)=0 and mod(i,4)=0) then
dbms_output.put(i);
end if;
i:=i+1;
end loop;
dbms_output.new_line;
end;
/
2.
declare
isi_bendungan number:=1000000;
sedot number:=1;
a number:=1;
begin
loop
sedot:=5000*24;
isi_bendungan:=isi_bendungan-sedot;
if (isi_bendungan<=0) then
isi_bendungan:=0;
end if;
dbms_output.put_line('hari ke '||a||' volume air '||isi_bendungan||' liter ');
a:=a+1;
exit when isi_bendungan<=0;
end loop;
end;
/

You might also like