Having issue with triangle with angle problem in Home » Compete » Getting started Practice Contest(in DSA learn)
in this problem i have submitted two program both similar but one wrong one right. want to know difference between them.(It is logical error).
#include
using namespace std;
int main() {
// your code goes here
short int a,b,c;
cin>>a>>b>>c;
if(a>0&&b>0&&c>0){
if((a+b+c)==180){
cout<<"YES";
}
}
else{
cout<<"NO";
}
return 0;
}
and other one is
#include
using namespace std;
int main() {
// your code goes here
short int a,b,c;
cin>>a>>b>>c;
if(a>0&&b>0&&c>0&&(a+b+c)==180){
cout<<"YES";
}
else{
cout<<"NO";
}
return 0;
}
Let me know what is logical error between them