by Dinesh Thakur Category: C Programming (Pratical)

This is C program that asks user to find the area of a triangle using math’s function. Here user declares some variables that use to store the value of it. User asks to enter the value of triangle three sides of triangle. Here after value user using the method to find the area of triangle. And then print the result on the screen.

Problem statement:

This is C program that asks user to find out the area of triangle.

  1. Declare the variable.
  2. Using method of Triangle area function.
  3. Display result on the screen.

Method of Find area of Triangle:

" Area=sqrt(s*(s-a)*(s-b)*(s-c)); "

Here is C source code for finding the area of triangle. The output of this program shown below.

# include<stdio.h>

#include<conio.h>
#include<math.h>
void main()
{
     int a,b,c;
     float area, s;
     clrscr();
     printf("Enter the Three Sides of Triangle : ");
     scanf("%d %d %d" ,&a, &b, &c);
     s=(a+b+c)/2.0;
     area=sqrt(s*(s-a)*(s-b)*(s-c));
     printf("Area of the Triangle= %f ", area);
     getch();

Area of a Triangle



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.