
Call 1800-123-2003
"Smartindia is the best online tool for school students." Ms Deepa Chandran, Principal Anchal
"Smartindia is one of the best supplementary education tool for school students." Ms Pooja, Principal
WRITE THE EQUATION TO FIND THE AREA OF ATRIANGLE IN C++ |
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; } |