In this code the input is given by the user.
DECLARE
a number := &enter_first_Number;
b number := &Enter_second_number ;
c number := &enter_third_number;
d number;
FUNCTION findMax(x IN number, y IN number, z IN number)
RETURN number
IS
w number;
BEGIN
IF x > y AND x > z THEN
w:= x;
ELSE IF y>x AND y>z THEN
w := y;
ELSE IF z>x AND z>y THEN
w := z;
END IF;
END IF;
END IF;
RETURN w;
END;
BEGIN
d := findMax(a, b, c);
dbms_output.put_line(' Maximum is ' || d);
END;
DECLARE
a number := &enter_first_Number;
b number := &Enter_second_number ;
c number := &enter_third_number;
d number;
FUNCTION findMax(x IN number, y IN number, z IN number)
RETURN number
IS
w number;
BEGIN
IF x > y AND x > z THEN
w:= x;
ELSE IF y>x AND y>z THEN
w := y;
ELSE IF z>x AND z>y THEN
w := z;
END IF;
END IF;
END IF;
RETURN w;
END;
BEGIN
d := findMax(a, b, c);
dbms_output.put_line(' Maximum is ' || d);
END;
No comments:
Post a Comment