fork download
  1. #include <stdio.h>
  2.  
  3. int test(int i) {
  4. int r = 0;
  5. switch(i) {
  6. case 1: r |= 1;
  7. case 2: r |= 2;
  8. case 4: r |= 4;
  9. default: ;
  10. }
  11. return r;
  12. }
  13.  
  14. int main() {
  15. const int v = 1;
  16. printf("%d -> %d\n", v, test(v));
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
1 -> 7