C Program to Find Area of a Triangle

In this tutorial you will learn about the C Program to Find Area of a Triangle and its application with practical example.

C Program to Find Area of a Triangle

In this tutorial, we will learn to create a C program that will Find the Area of a Triangle in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • Mathematical operations in C programming.

Algorithm:-

Program description:-

In today’s tutorial, we will create a program, that will calculate the area of a triangle using C programming. First, take the input three sides of the triangle by the user. Then we will calculate the area of that triangle using the mathematical expression. At last, we will print the area of a triangle.

Program Code:-

Output:-

In the above program, we have first initialized the required variable.

 

  •  x = it will hold the integer value for the input side of the triangle.
  •  y = it will hold the integer value for the input side of the triangle.
  •  z = it will hold the integer value for the input side of the triangle.
  • area = it will hold the area of the triangle.

Taking Input the three sides length the triangle.

Code to calculate the area of the triangle.

Printing output the area of the triangle.

In this tutorial we have learn about the C Program to Find Area of a Triangle and its application with practical example. I hope you will like this tutorial.