Consider the PL/SQL package below that contains the universal constants.

CREATE OR REPLACE PACKAGE pkg_universal_constants
IS
  v_pi CONSTANT NUMBER(6,2) := 3.14;
  v_light_speed CONSTANT NUMBER(15,2) := 3*(10**8);
END;

Examine the below PL/SQL code to calculate the area of circle.

DECLARE
  v_radius NUMBER(10,2):=10;
  v_area   NUMBER(10,2);
BEGIN

  /* Calculate the area of circle using v_pi constant variable from pkg_universal_constants package*/
  
  DBMS_OUTPUT.PUT_LINE('Area of circle :'||v_area);
END;

Choose the appropriate code to calculate the area of circle.

 

 

v_area:=v_pi*v_radius*v_radius;
v_area:=pkg_universal_constants.v_pi*v_radius*v_radius;
v_area:=pkg_universal_constants.v_pi*pkg_universal_constants.v_radius*pkg_universal_constants.v_radius;
You cannot use variable v_pi of pkg_universal_constants outside the package
Verified Answer
Correct Option - b

To get all PLSQL Assessment Exam questions Join Telegram Group https://bit.ly/infy_premium_group

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Fri, 13 Jun 2025