28.4k views
5 votes
Write a pascal program for finding the perimeter of triangle

User Cozek
by
7.9k points

1 Answer

3 votes

Final answer:

To find the perimeter of a triangle, use the formula P = a + b + c, where a, b, and c are the lengths of the sides.

Step-by-step explanation:

To find the perimeter of a triangle, you need to know the lengths of all three sides. Here's a Pascal program that calculates the perimeter:

program PerimeterTriangle;

var
Side1, Side2, Side3, Perimeter: real;

begin
writeln('Enter length of side 1: ');
readln(Side1);
writeln('Enter length of side 2: ');
readln(Side2);
writeln('Enter length of side 3: ');
readln(Side3);
Perimeter := Side1 + Side2 + Side3;
writeln('Perimeter of the triangle: ', Perimeter);
end.

User Moshevi
by
7.4k points