SQL> set serveroutput on
SQL> declare
2 a number;
3 b number;
4 c number;
5 begin
6 a:=&a;
7 c:=&c;
8 for b in 1..c
9 loop
10 dbms_output.put_line(b||'x'||a||'='||b*a);
11 end loop;
12 end;
13 /
Enter value for a: 2
old 6: a:=&a;
new 6: a:=2;
Enter value for c: 10
old 7: c:=&c;
new 7: c:=10;
1x2=2
2x2=4
3x2=6
4x2=8
5x2=10
6x2=12
7x2=14
8x2=16
9x2=18
10x2=20
PL/SQL procedure successfully completed.
SQL> declare
2 a number;
3 b number;
4 c number;
5 begin
6 a:=&a;
7 c:=&c;
8 for b in 1..c
9 loop
10 dbms_output.put_line(b||'x'||a||'='||b*a);
11 end loop;
12 end;
13 /
Enter value for a: 2
old 6: a:=&a;
new 6: a:=2;
Enter value for c: 10
old 7: c:=&c;
new 7: c:=10;
1x2=2
2x2=4
3x2=6
4x2=8
5x2=10
6x2=12
7x2=14
8x2=16
9x2=18
10x2=20
PL/SQL procedure successfully completed.
No comments:
Post a Comment