Program to input the three sides of triangle and output the area of the triangle
Answers
Answered by
1
Answer:
/*
* C program to find the area of a triangle, given three sides
*/
#include <stdio.h>
#include <math.h>
void main()
{
int s, a, b, c, area;
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);
}
Similar questions
Math,
6 months ago
Science,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
Chemistry,
1 year ago