PL/SQL Program to Find Largest from Two Numbers

PL/SQL Program to Find Largest from Two Numbers:

declare
a number;
b number;
begin
a:=:a;
b:=:b;
dbms_output.put_line('Value of a:'||a);
dbms_output.put_line('Value of b:'||b);

if (a>b)
then
    dbms_output.put_line(a||' is Largest Number');
else
    dbms_output.put_line(b|| ' is Largest Number');
end if;
end;

OUTPUT:

Value of a:3
Value of b:10
10 is Largest Number

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.