Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

NEED SAMPLE AND BASIC C-- OR C++ PROGRAMMING EXCUTION The angle in the diagram b

ID: 638509 • Letter: N

Question

NEED SAMPLE AND BASIC C-- OR C++ PROGRAMMING EXCUTION The angle in the diagram below can test to detemine if it is less then 90degree through the following equation to show that it is an acute triangle: a^2 + b^2 - c^2 > 0 where c is the length of longest side of the triangle Write a C-- program or devc++ that reads in a, b, and c; and verifies that it is an acute triangle. If c is less than the other two dimensions, or if any of a,b, and c are not positive c is greater than a+b so a triangle can?t be formed, your program should output a message instead of outputting a result . Otherwise your program should output a message stating whether the triangle is acute or not. Your program does not need to loop, i.e. it reads in and processes one set of values and then stops. Note: a=6, b=8, c=9 is an example of an acute triangle that you can use. The angle in the diagram below can test to detemine if it is less then 90degree through the following equation to show that it is an acute triangle: a^2 + b^2 - c^2 = 0 where c is the length of longest side of the triangle Write a C-- program or devc++ that reads in a, b, and c; and verifies that it is an acute triangle. If c is less than the other two dimensions, or if any of a,b, and c are not positive c is greater than a+b so a triangle can?t be formed, your program should output a message instead of outputting a result . Otherwise your program should output a message stating whether the triangle is acute or not. Your program does not need to loop, i.e. it reads in and processes one set of values and then stops. Note: a=6, b=8, c=9 is an example of an acute triangle that you can use.

Explanation / Answer

Here you go :)

commnet if you have any doubts

#include <iostream>

using namespace std;

int main()
{
double a,b,c;
cout << "Enter a b c values" << endl;
cin >> a>> b>>c;
if((c<a && c<b) || (a<=0 || b<=0||c<=0) || c>a+b)
{
cout<<"Error!! invalid inputs"<<endl;
}
else
{
if(a*a +b*b -c*c >0)cout<<"Given triangle is an Acute"<<endl;
else cout<<"Given triangle is an Obtuse"<<endl;
}
return 0;
}