function_rectangle_area
Sat Jun 08 2024 02:03:06 GMT+0000 (Coordinated Universal Time)
Saved by
@signup
CREATE OR REPLACE FUNCTION rectangle_area (length IN NUMBER,width IN NUMBER) RETURN NUMBER IS
area NUMBER;
BEGIN
area := length * width;
RETURN area;
END rectangle_area;
/
DECLARE
length NUMBER := 5;
width NUMBER := 4;
area NUMBER;
BEGIN
area := rectangle_area(length, width);
DBMS_OUTPUT.PUT_LINE('Length: ' || length);
DBMS_OUTPUT.PUT_LINE('Width: ' || width);
DBMS_OUTPUT.PUT_LINE('Area of the rectangle: ' || area);
END;
/
content_copyCOPY
Comments