Question: i am having trouble figuring out... The program runs, but terminates after asking for the three sides (returns a message that Sum of 2 sides

i am having trouble figuring out... The program runs, but terminates after asking for the three sides (returns a message that "Sum of 2 sides must be less..."). The program never gets to carry out the "switch" ... PLEASE SEE FAULTY CODE BELOW... Need help figuring out why the program doesnt carry all the way out through the switch function, etc...

#include #include // for using M_PI (value of pi) #include // for using inverse trignometric functions using namespace std; void angle(float a,float b, float c) { /*****using cosine formula we can easily calculate the angles of each vertex*****/ cout<<"The angles are : "; cout<<(float)acos((b*b + c*c - a*a)/(2*b*c))*180/M_PI<<"\370"; // \370 is used for the degree sign // cout<<", "; cout<<(float)acos((b*b + a*a - c*c)/(2*b*a))*180/M_PI<<"\370"; cout<<", "; cout<<(float)acos((a*a + c*c - b*b)/(2*a*c))*180/M_PI<<"\370 "; float s = (a+b+c)/2; cout<<"Area of triangle = "<>a>>b>>c; if(a<0 || b<0 c<0) { cout<<"negative value for side not allowed."; return 1; } else if(a+b return 1; } cout<<"1.Find the angles. "; cout<<"2.Radius of incircle & remaining area of triangle. "; cout<<"3.Radius of circumcircle % remaining area of circle. "; cout<<"Enter your choice : "; int ch; cin>>ch; switch(ch) { case 1: angle(a,b,c); break; case 2: incircle(a,b,c); break; case 3: circumcircle(a,b,c); break; default : break; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!