Advertisement
NPantev

Untitled

Jun 26th, 2022
650
130 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None
  1. /*
  2. 9) Направете нa нула битовете в числа, намиращи се на
  3. позиции между 3 и 7. (0b00000111 ?)
  4. */
  5.  
  6. #include <stdio.h>
  7.  
  8. int main()
  9. {
  10.     int mask = 0b00000111; // binary of 7
  11.    
  12.     int five = 0b00000101; // binary of five
  13.     printf("five = %d\n", five);
  14.     printf("---------------\n");
  15.  
  16.     int result = five | mask;
  17.    
  18.     printf("five | mask = %d\n", result);
  19.  
  20.    
  21.  
  22.  
  23.  
  24.  
  25.     return 0;
  26. }
Advertisement
RAW Paste Data Copied
Advertisement