Tuesday, February 10, 2015

Calculate the area of a triangle

/* Calculate the area of a triangle */ #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); getch(); return 0; }

Share

& Comment

0 comments:

Post a Comment

 

Copyright © 2015 Code Fervor™ is a registered trademark.

Designed by Templateism By Naman Kumar