Completely Solved C, C++ Programs Assignment.




C Program to find area of a triangle when there sides are given

Filed Under:

Problem 63. C Program to find area of a triangle when there sides are given.
#include<stdio.h>
#include<conio.h>
main( )
{
int a,b,c;
float s, area;
clrscr( );
printf(“enter there sides of the triangle”);
scanf(“%d%d%d”,&a,&b,&c);
if((a+b)<c||(b+c)<a||(a+c)<b)
printf(“finding area is not possible”);
else
s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf(“area=%.2f”,area);
getch( );
}

C compiler: gcc 4.1.2

 Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments