Saturday, 12 December 2015

Write a program that find out the area of triangle when three sides a,b,c of triangle are given use appropriat statement to input the value of a,b,c from the keyboard . formula for the area of triangle is area= sqrt[s(s-a)(s-b)(s-c)]

#include<iostream>
#include<conio.h>
#include<math.h>
 using namespace std;
 int main()
 {
     float a,b,c,S,Area;
     cout<<"enter the value of first side:"<<endl;
    cin>>a;
       cout<<"enter the value of second side:"<<endl;
       cin>>b;
         cout<<"enter the value of third side:"<<endl;
         cin>>c;
         S=(a+b+c)/2;
         Area=sqrt(S*(S-a)*(S-b)*(S-c));
         cout<<"The required area = "<<Area;
         getch();
         }

No comments:

Post a Comment