C program to find the area of a triangle, given three sides
by Nideesh C on April 11, 2011 · 0 comments
in C Programming
/* C program to find the area of a triangle, given three sides*/
#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{
int s, a, b, c, area;
clrscr();
printf(“Enter the values of a,b and c\n”);
scanf (“%d %d %d”, &a, &b, &c);
/* compute s*/
s = (a + b + c) / 2;
area = sqrt ( s * (s-a) * (s-b) * (s-c));
printf (“Area of a triangle = %d\n”, area);
}
/*—————————–
Output
Enter the values of a,b and c
3
4
5
Area of a triangle = 6
——————————*/
Not Satisfied ? Just search & get the result
Related posts:
- Sample – Program to print the first 10 lines of pascal’s triangle.
- Sample – Program to find the roots of a quadratic equation.
- Sample – compute distance between cities
- Sample – Program to find the sum of each row & column of a matrix of size n x m and if matrix is square, find the sum of the diagonals also..
- Sample – compute square roots using Newton’s method
Tagged as:
area,
area of a trangle,
c program,
C program to find the area of a triangle,
C++ Programming,
given three sides,
trangle
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.