pascal area of triangle

Pascal Area of Triangle

To calculate the area of a triangle in Pascal, you can use the formula:

Area = (base * height) / 2

Where the base is the length of the triangle's base and the height is the perpendicular distance from the base to the opposite vertex.

Here's an example code snippet in Pascal that calculates the area of a triangle:

program AreaOfTriangle;
var
  base, height, area: real;
begin
  writeln('Enter the base of the triangle: ');
  readln(base);

  writeln('Enter the height of the triangle: ');
  readln(height);

  area := (base * height) / 2;

  writeln('The area of the triangle is: ', area);
end.

This code prompts the user to enter the base and height of the triangle, calculates the area using the formula, and then displays the result.

Please note that this is just a basic example, and you may need to modify it according to your specific requirements.