Answer to Question #235320 in Databases | SQL | Oracle | MS Access for Tarurendra Kushwah

Question #235320

Write a PL/SQL program to find area and perimeter of rectangle.


1
Expert's answer
2021-09-13T05:27:03-0400
DECLARE
  -- Declaration of length and assigning values 
  l NUMBER(4, 2) := 3; 
  --Declaration of breadth and assigning values 
  b NUMBER(4, 2) := 7; 
  --Declaration of a variable for Area of rectangle 
  a NUMBER(4, 2); 
  
  --Declaration of a variable for perimeter 
  p NUMBER(4, 2); 
BEGIN 
    
  -- calculate area and perimeter
  a := l * b; 
  p := 2 * (l + b); 
  
  --Display result 
  dbms_output.Put_line('Area of the rectangle is  ' 
  || a); 
  dbms_output.Put_line('Perimeter of the rectangle is ' 
  || p); 
END; 
--ENd program

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS