Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

bunyonb

2. Write a program which, given three values representing the sides of a triangle prints: * 0 if the values cannot be the sides of any triangle. This is so if any value is negative or zero, or if any length is greater than the sum of the other two. * 1 If the triangle is equilateral. * 2 If the triangle is isosceles * 3 if the triangle is scalene.

  • one year ago
  • one year ago

  • This Question is Closed
  1. bunyonb
    Best Response
    You've already chosen the best response.
    Medals 0

    HERE IS MY CODE SO FAR: /*Write a program which, given three values representing the sides of a triangle prints: * 0 if the values cannot be the sides of any triangle. This is so if any value is negative or zero, or if any length is greater than the sum of the other two. * 1 If the triangle is equilateral. * 2 If the triangle is isosceles * 3 if the triangle is scalene.*/ #include <iostream> #include <cmath> using namespace std; int main(){ double a,b,c; cout<<"enter 3 values of your triangle"<< endl; cin>>a>>b>>c; if( (a==b&& a!=c) || (a==c && a!=b) || (b==c && b!=a) ) { cout<< " This triangle is Isosceles"<<endl; } else if( a==b && a==c){ cout<< "This triangle is equilateral"<<endl; } else if (a!=b && a!=c){ cout<<" This triangle is scalene"<<endl; } return 0; }

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.