fork download
  1. // C Program to demonstrate use of bitwise operators
  2. #include <stdio.h>
  3. int main()
  4. {
  5. unsigned int bit_seven_flag = 0x80;
  6. unsigned int res = 0x60;
  7. unsigned int mask = 0xE0;
  8. unsigned int reg = 0xAF;
  9.  
  10. if ((reg & mask) == ((bit_seven_flag | res) & mask))
  11. {
  12. printf("Match.");
  13. } else {
  14. printf("Doesn't match.");
  15. }
  16.  
  17.  
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 4264KB
stdin
Standard input is empty
stdout
Doesn't match.