Question #4727

c++ program to find area,perimeter,volume of a rectangle using seperate function

Expert's answer

#include "iostream"

#include "math.h"

using namespace std;

double triangle(int a, int b, int c)

{

int P;

double S;

P = a + b + c;

cout<<P<<endl;

S = (a*b*c)/(4*sqrt((a+b+c)*(b+c-a)*(a+c-b)*(a+b-c)));

cout<<S<<endl;

return 0;

}

int main()

{

int a,b,c;

cout<<"Input triangle plz"<<endl;

cin>>a>>b>>c;

triangle(a,b,c);

system ("pause");

return 0;

}

#include "math.h"

using namespace std;

double triangle(int a, int b, int c)

{

int P;

double S;

P = a + b + c;

cout<<P<<endl;

S = (a*b*c)/(4*sqrt((a+b+c)*(b+c-a)*(a+c-b)*(a+b-c)));

cout<<S<<endl;

return 0;

}

int main()

{

int a,b,c;

cout<<"Input triangle plz"<<endl;

cin>>a>>b>>c;

triangle(a,b,c);

system ("pause");

return 0;

}

## Comments

## Leave a comment