c - How to compare number against an interval? ( x > (1,10)) -


how compare 1 number against interval.

is there way shorten expression:

if ((x%10) == 1 || (x%10) == 2 ||  (x%10) == 3 || (x%10) == 4 ) // ... till number 9. 

assuming x integer, there 10 possible values. , 1 not checked, 0, false integer.

if (x % 10) {    ... 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -