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)) | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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 ответ
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