Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

my code isn't running giving me errors #include lt;iostreamgt; using namespace std; // function isImpossibleTriangle bool isImpossibleTriangle(int

my code isn't running giving me errors

#include <iostream>

using namespace std;

// function isImpossibleTriangle

bool isImpossibleTriangle(int a, int b, int c)

{

// variable declaration

bool flag = true;

if(((a+b) > c) == false){

flag = false;

}

if(((a+c) > b) == false){

flag = false;

}

if(((c+b) > a) == false){

flag = false;

}

return flag;

}

int main()

{

// variable declaration

int a,b,c;

bool result;

//prompt user for input

cout << "Enter a : ";

cin >> a;

cout << "Enter b : ";

cin >> b;

cout << "Enter c : ";

cin >> c;

cout << endl;

//call to the function

result = isImpossibleTriangle(a,b,c);

if(result == true){

cout << "Possible Triangle" << endl;

}

else{

cout << "Impossible Triangle" << endl;

}

return 0;

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question