I want to write a c++ program that finds whether the triangle is valid or not
here's my code:
#include <iostream>
using namespace std;
int main () {
int a,b,c;
cin>>a>>b>>c;
if (a+b+c==180)
cout <<"Yes";
else
cout <<"No";
return 0;
}
The user will enter 3 angles e.g 50 30 100 it will print valid Yes, but what if he enters
0 0 180 it will print yes by entering only one angle. that isn't triangle and my program will print yes. What should I do to fix this?