Opening Hours :7AM to 9PM
LOOP Sequence of statements; END LOOP;
DECLARE x number := 1; BEGIN LOOP dbms_output.put_line(x); x := x + 1; IF x > 10 THEN exit; END IF; END LOOP; -- after exit, control resumes here dbms_output.put_line('After Exit x is: ' || x); END; /
DECLARE x number := 1; BEGIN LOOP dbms_output.put_line(x); x := x + 1; exit WHEN x > 10; END LOOP; -- after exit, control resumes here dbms_output.put_line('After Exit x is: ' || x); END; /
declare x int:=10; begin loop dbms_output.put_line(x); if(x<=0) then exit; end if; x:=x-1; end loop; end; /
declare x int:=10; begin loop if(x mod 2=0)then dbms_output.put_line(x); end if; if(x<=0) then exit; end if; x:=x-1; end loop; end; /
loop loop ... ... end loop; ... ... end loop;in the above syntax
*** *** *** *** *** *** declare r int; c int; begin r:=1; loop c:=1; loop dbms_output.put('*'); if(c>=3) then exit; end if; c:=c+1; end loop; dbms_output.put_line(''); if(r>5) then exit; end if; r:=r+1; end loop; end; /
* ** *** **** ***** ****** declare r int; c int; begin r:=1; loop c:=1; loop dbms_output.put('*'); if(c>=r) then exit; end if; c:=c+1; end loop; dbms_output.put_line(''); if(r>5) then exit; end if; r:=r+1; end loop; end; /
****** ***** **** *** ** * declare r int; c int; begin r:=1; loop c:=6; loop dbms_output.put('*'); if(c<=r) then exit; end if; c:=c-1; end loop; dbms_output.put_line(''); if(r>5) then exit; end if; r:=r+1; end loop; end; /
******* * * * * * * * * * * ******* declare r int; c int; begin r:=1; loop c:=7; loop if(r=1 or r=7 or c=1 or c=7) then dbms_output.put('*'); else dbms_output.put(' '); end if; if(c<=1) then exit; end if; c:=c-1; end loop; dbms_output.put_line(''); if(r>=7) then exit; end if; r:=r+1; end loop; end; /
* * * ******* * * * declare r int; c int; begin r:=1; loop c:=7; loop if(r=4 or c=4) then dbms_output.put('*'); else dbms_output.put(' '); end if; if(c<=1) then exit; end if; c:=c-1; end loop; dbms_output.put_line(''); if(r>=7) then exit; end if; r:=r+1; end loop; end; /
* ** *** **** ***** ****** ******* declare r int; c int; begin r:=1; loop c:=7; loop if(r>=c) then dbms_output.put('*'); else dbms_output.put(' '); end if; if(c<=1) then exit; end if; c:=c-1; end loop; dbms_output.put_line(''); if(r>=7) then exit; end if; r:=r+1; end loop; end; /