fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int test = 129;
  5. int modValue, andValue;
  6. modValue = test % -8;
  7. andValue = test % 7;
  8. printf("Mod Value = %d And Value = %d\n", modValue, andValue);
  9.  
  10.  
  11. int counter = 0;
  12. for(counter = 0; counter < 10000; counter++) {
  13. modValue = abs(-counter % -16);
  14. andValue = counter & 15;
  15. if(modValue != andValue) {
  16. printf("diff found at %d\n", counter);
  17. }
  18. }
  19.  
  20. printf("loop done");
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
Mod Value = 1 And Value = 3
loop done