fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int A = 12;
  5. int B = 11;
  6. int L = 2;
  7. int R = 3;
  8. int bitResult = A | ((1 << R) - (1 << (L-1)) & B);
  9. printf("%d\n",bitResult);
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
14