PL/SQL Program to Find Greatest of Three Numbers

Here you will get plsql program to find greatest of three numbers.

declare
	a number:=10;
	b number:=12;
	c number:=5;
begin
	dbms_output.put_line('a='||a||' b='||b||' c='||c);
	if a>b AND a>c
	then
		dbms_output.put_line('a is greatest');
	else
		if b>a AND b>c
		then
			dbms_output.put_line('b is greatest');	
		else
			dbms_output.put_line('c is greatest');
		end if;
	end if;
end;
/

Output

a=10 b=12 c=5
b is greatest

4 thoughts on “PL/SQL Program to Find Greatest of Three Numbers”

  1. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘on
    declare
    a_number:=10;
    b_number:=12;
    c_number:=5;
    begin
    ‘dbms_output.put_l’ at line 1

Leave a Comment

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