Your approach would indeed seem more natural but that really depends on the language you use for the implementation.
Rationale for the Mess
C being a systems programming language, and fairly close to the hardware (funny though, as we used to consider a "high-level" language, as opposed to writing machine code), it's not exactly expressive.
Modern higher-level languages (again, arguable, lisp is not that modern, historically speaking, but would allow you to do that nicely) allow you to do such things by using built-in constructs or library support (for instances, using Ranges, Tuples or equivalents in languages like Python, Ruby, Groovy, ML-languages, Haskell...).
Possible Solution 1
One option for you would be to implement a function taking an array of values and checking them.
Here's a basic prototype, and I leave the implementation as an exercise to you:
int is_in(int check, int *values, int size); // returns non-zero value if check is in values
However, as you will quickly see, this is very basic and not very flexible:
- it works only on integers,
- it works only to compare identical values.
Possible Solution 2
An alternative would be to use pre-processor macros in C (or C++) to achieve a similar behavior, but beware of side effects.
Keep Going
A next step could be to pass a function pointer as an extra parameter to define the behavior at call-point, define several variants and aliases for this, and build yourself a small library of comparators.
The next step then would be to implement a similar thing in C++ using templates to do this on different types with a single implementation.
And then keep going from there to higher-level languages.
Pick the Right Language (or learn to let go!)
Typically, languages favoring functional programming will have built-in support for this sort of thing, for obvious reasons.
Or just learn to accept that some languages can do things that others cannot, and that depending on the job and environment, that's just the way it is.
Maybe a library implements such a thing already, than I am not aware of.