- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Find the area and perimeter of right triangle in PL/SQL
In this problem, we are given three values: base, height and hypotenuse of a right triangle. Our task is to find the area and perimeter of the right triangle in PL/SQL.
PL/SQL is a combination of SQL along with the procedural features of programming languages
Let's take an example to understand the problem,
Input : height = 4, base = 3, hypotenuse = 5 Output : area = 6, perimeter = 12
1 + 22 + 333 + 4444 = 4800
A simple approach to solve the problem is using the formula for the area and perimeter of the triangle.
Area = 1/2*(height)*(base)
Perimeter = (height) + (base) + (hypotenuse)
Program to illustrate the working of our solution in PL/SQL
DECLARE hypotenuse FLOAT; base FLOAT; height FLOAT; area FLOAT; perimeter FLOAT; BEGIN hypotenuse := 13; base := 5; height := 12; area := (1/2)* base * height; perimeter := hypotenuse + height + base; dbms_output.Put_line('The Perimeter of triangle is ' || perimeter); dbms_output.Put_line('The Area of triangle is ' || area); END;
The Perimeter of triangle is 30 The area of triangle is 30
- Program to calculate area and perimeter of equilateral triangle
- Floyd's triangle in PL/SQL
- Program to calculate area and perimeter of equilateral triangle in C++
- Difference between SQL and PL/SQL
- Find Perimeter of a triangle in C++
- Area of Circumcircle of a Right Angled Triangle?
- Program to calculate the Area and Perimeter of Incircle of an Equilateral Triangle What is Equilateral Triangle in C?
- Difference Between T-SQL and PL-SQL
- Find the Number of Possible Pairs of Hypotenuse and Area to Form Right Angled Triangle using C++
- Program to find the Area and Perimeter of a Semicircle in C++
- Find the factorial of a number in pl/sql using C++.
- Find the altitude and area of an isosceles triangle in C++
- Area of Incircle of a Right Angled Triangle in C Program?
- Area of Circumcircle of a Right Angled Triangle in C Program?
- What is PL/SQL?