**C program for area of a triangle**

**Formula of area of any triangle:**

Area = √(s*(s-a)*(s-b)*(s-c))

Where s = (a + b + c)/2

**C code:**

#include<stdio.h>

#include<math.h>

int main(){

float a,b,c;

float s,area;

printf("Enter
size of each sides of triangle");

scanf("%f%f%f",&a,&b,&c);

s
= (a+b+c)/2;

area
= sqrt(s*(s-a)*(s-b)*(s-c));

printf("Area of
triangle is: %.3f",area);

return 0;

}

**Sample output:**

Enter size of each sides of the triangle: 2 4 5

Area of triangle is: 3.800

7. Write a c program to find the area of rhombus.

8. Write a c program to find the area of parallelogram.

this answer is wonderful really i like you

ReplyDeletewhen i put 2 4 6 shows wrong answer

ReplyDeletei.e., when s= even

thats not a valid tringle.....for a valid tringle {if(a+b>c && b+c>a && c+a>b)}

ReplyDeleteI missed a thing i.e your a(2)+b(4)is not greater then c(6)

ReplyDeletethanks

ReplyDeleteWho made this program in this website thank you very much. May god give you power and arrange to you all the situation to help the other like this.

ReplyDeleteThanx for the help

ReplyDeleteThanks for the help...but what if write float a,b,c,s,area; instead of

ReplyDeletefloat a,b,c;

float s,area;

Write a C program to print the following triangle:

ReplyDeletethnks man this makes programing c easy

ReplyDeletewhy you write in last printf 3f

ReplyDeleteplease help me. i want to write a program in C. that gets 3 sides and gives 3 angles. pleaseeeeee

ReplyDeletethis is my mail.. please heeeeeelp me. leylakalhor@rocketmail.com

ReplyDelete