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

javascript - ScrollTo Effect (href to div) -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -