PL/SQL Program to Find Largest from Three Numbers

PL/SQL Program to Find Largest from Three Numbers:

Declare
a number;
b number;
c number;
Begin
a:=:a;
b:=:b;
c:=:c;
dbms_output.put_line('Value of a:'||a);
dbms_output.put_line('Value of b:'||b);
dbms_output.put_line('Value of c:'||c);

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

OUTPUT:

Value of a:5
Value of b:7
Value of c:8
8 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.