Is there a simple way to see if an integer falls in a range?
like
int x = 15;
if(x==1x)
{
std::cout << "Yes it falls in the range 10-19" << std::endl;
}
As far as I understand, the closest thing to that is
((x>9) && (x<20))?(std::cout << "Yes" << std::endl):(std::cout << "No" << std::endl);
Or something like that.
Is there something like the first way?
No there is no other way than the second version you have.