This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Friday 21 June 2013

Program to find the area of a Triangle

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int a,b,c;
float s,d,area;
clrscr();
printf("Enter the length of the three sides");
scanf("%d%d%d",&a,&b,&c);
s=(a+b+c)/2;
d=(s*(s-a)*(s-b)*(s-c));
area=sqrt(d);
printf("Area of the triangle = %f sq units", area);
getch();
}

1 comment: