How about (off the top of my head and untested):
if ( !( ((a|b|c|d...z) == value) && ((a&b&c&d...z) == value) ) )
/* one or more of a,b,c,d...z is not equal to value */
Or the similarly silly:
if (a^value|b^value|c^value|...|z^value)
/* one or more of a,b,c,...,z is not equal to value */
(Untested, but I think that's right.) Or similarly:
if (a^b|b^c|c^d|...|y^z|z^value)
All assuming that we're working with values that aren't going to
produce trap representations, or with unsigned types.
Of course this is just a bitwise version of (in the second case):
if (a!=b || b!=c || ... || z!=value)
except that the logical version can short-circuit, so fewer
operations are performed. (Though it's conceivable that on some
systems it'd be faster to perform all the bitwise operations than
to do the comparing and branching required to implement short-
circuiting.)
I don't think that would generally be as efficient as using multiple
comparisons against value because in that case the first mismatch will
prevent the rest from being evaluated.
More important, it's lousy code, and performance is rarely as
important as maintainability. And if performance *is* crucial in
this case, then it's probably time to redesign - it's unlikely that
keeping a lot of independent variables and testing them all against a
single value is actually the best way to accomplish whatever it is
that the problem requires.
That said, in some code I might find it defensible to write this as
a multiline controlling expression in an if statement (using the
logical operators, not the bitwise ones), as long as it was clear.