Make a program in C++ that tells the Area of Traingle

#include <iostream>

#include<cmath>

using namespace std;

int main()

{

int a,b,c,s,A;

cout<<"Enter Value of first side"<<endl;

cin>>a;

cout<<"Enter Value of second side"<<endl;

cin>>b;

cout<<"Enter Valueof third side"<<endl;

cin>>c;

s=(a+b+c)/2;

cout<<"Sum of all sides is ="<<s<<endl;

A=sqrt(s*(s-a)*(s-b)*(s-c));

cout<<" The Area of Traingle is = "<<A<<endl;


}


Ø Output of Program



No comments:

Post a Comment

Total Pageviews