Back To C++ Built-In Functions Index
//program to find area of a triangle using sqrt function in math.h ( sqrt function is used to calculate square root of a number ) #include
#include
#include
void main() { int a,b,c; float area,s; clrscr(); cout<<"enter side 1 of triangle "; cin>>a; cout<<"enter side 2 of triangle "; cin>>b; cout<<"enter side 3 of striangle "; cin>>c; s=(a+b+c)/2; area=sqrt(s*(s-a)*(s-b)*(s-c)); cout<<"area of triangle is "<