is there any way how to check if the variable equals some value faster way than doing if statement ( m == value1 || m == value2 || m == value3...)
I tried if m == ( value1 || value2 || ...)
but it works only for the first value. Here's an example, it returns true for 1 but not for 5 and the rest. I really appreciate all suggestions. TY!
#include <stdio.h>
int main(void){
int m;
scanf("%i", &m);
if(m == (1 || 5 || 7 || 8 || 11 || 20)){
printf("TRUE\n");
}
else {
printf("FALSE\n");
}
return 0;
}