0

Write a function to compute area of triangle. Sides are passed as parameter by the user. Area =sqrt(s*(s-a) *(s-b)*(s-c))

Please tell the answer. Where s=(a+b +c)/2

14th Jan 2017, 12:26 PM
Vaibhav kumar
Vaibhav kumar - avatar
1 Odpowiedź
0
#include <iostream> #include <cmath> using namespace std; int main() { int a=5; int b=4; int c=6; float s= float((a+b+c))/2; float area=sqrt(s*(s-a)*(s-b)*(s-c)); cout <<area; return 0; }
14th Jan 2017, 12:53 PM
ASNM
ASNM - avatar