Area of Triangle Program in C Language

Spread the love

Area-of-Traingle-Program-in-C-Language-with-algorithm

Introduction:

In this article, We are going to look at the Area of Triangle Program in C Language.

Most of us already know, What is a triangle and the formula to calculate the area of the triangle. Here is the area formula.

Area of Triangle Formula:

Area = ½ × b × h

Where b = Base and h = Vertical Height

Area of Triangle Program Algorithm:

  • The Program should accept the two integer values from the user and store them as the Height and Base of Triangle.
  • Then We are going to apply the above Area formula ( 1/2 * Height * Base ) or ( 0.5 * Height * Base ) on the given numbers.
  • Which gives us the Area of the triangle. Display the result onto the console.

Area of Triangle Program in C Language:

Program Output:

We are going to compile the program using the GCC compiler under the Ubuntu Linux system.

Related C Programs:

C Star and Number Pattern programs:

C Tutorials Index:

Venkat

Hi Guys, I am Venkatesh. I am a programmer and an Open Source enthusiast. I write about programming and technology on this blog.

You may also like...

Leave a Reply