Q. Write PL/SQL Block Which Will Find Maximum Number Between Three Numbers?
DECLARE
a NUMBER:=&Input_First_no.;
b NUMBER:=&Input_Second_no.;
c NUMBER:=&Input_Third_no.;
BEGIN
IF (a>b) THEN
IF(a>c)THEN
DBMS_OUTPUT.PUT_LINE(a||' is greatest !');
ELSE
DBMS_OUTPUT.PUT_LINE(c||' is greatest !');
END IF;
ELSIF(b>c)THEN
DBMS_OUTPUT.PUT_LINE(b||' is greatest !');
ELSIF(a=b)AND(b=c) THEN
DBMS_OUTPUT.PUT_LINE(a||' '||b||' '||c||' All Numbers Are Same !');
ELSE
DBMS_OUTPUT.PUT_LINE(c||' is greatest !');
END IF;
END;
/
Enter value for input_first_no: 0.55
Enter value for input_second_no: 0.56
Enter value for input_third_no: 0.54
0 comments:
Post a Comment