RDBMS SOLUTION
ASSIGNMENT 1
SET A Q.1 SOLUTION
Write a PL/SQL block to accept a number and display multiplication table of the given number.
Source code:
/*set a Q.1
in this we will use a simple loop to print
multiplication table of the input number
*/
/*declare section*/
declare
n number:=:number; /*this will be input*/
i number:=1; /*the number which will be incremented*/
/*begin section*/
begin
loop
dbms_output.put_line(n||'x'||i||'='||i*n);
/*increment i*/
i:=i+1;
exit when i=10;
end loop;
end;
0 Comments