fork download
  1. #include <stdio.h>
  2.  
  3. int fitsBits(long long x, int n) {
  4. long long r;
  5. int c;
  6. c = 65 + ~n;
  7. r = !(((x << c)>>c)^x);
  8. return r;
  9. }
  10.  
  11. int main() {
  12. printf("%d\n", fitsBits(0x80000000, 0x20));
  13. return 0;
  14. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
0