The following pattern represents P(5) as :
* * * * *
* * * *
* * *
* *
*
Here you can change the value of i to print
different sized patterns.
DECLARE i integer ; j integer; BEGIN
i := 5; ----change for different patterns
<<outloop>> LOOP j := i; <<inloop>> LOOP dbms_output.put('*'|| ' '); j :=j - 1; exit inloop when (j = 0); exit outloop when (i = 0); end loop inloop; dbms_output.put_line(' '); i := i - 1; end loop outloop; END;
No comments:
Post a Comment