PL SQL program to print multiplication table for a number

-- This program prints the multiplication table for any number, the number and the limit should be given as input.

declare
n number(5);
i number(2);
m number(5);
limit number(5);
begin
i:=1;
n:=&n;  -- The number for which multiplication table should be printed.
limit:=&l;  -- This specifies the limit of the table.
dbms_output.put_line('Multiplication table for '|| n);
for i in 1..limit
loop
m:=n*i;
dbms_output.put_line(n||'*'||i||'='||m);
end loop;
end;

Output

Multiplication table PL SQL




3 comments:

Rahul said...

Write a PL/SQL code to print tables of all even numbers up to
10?

Rahul said...

Write a PL/SQL code to print tables of all even numbers up to
10?

Rahul said...

Write a PL/SQL code to find the sum of digits of even digits
from a number fetched from a table using implicit cursors and
check if the sum is prime number or not?