Concatenating Integer variables

Using the ternary operator.

The ternary conditional operator checks the boolean value of the first expression and, depending on the resulting value, evaluates and returns either the second if true or the third expression if false.

int intConcat = intNo1 ?  1 : 0
              | intNo2 ?  2 : 0
              | intNo3 ?  4 : 0
              | intNo4 ?  8 : 0
              | intNo5 ? 16 : 0
              | intNo6 ? 32 : 0
              | intNo7 ? 64 : 0
              | intNo8 ?128 : 0;