Advertisement
lIlIlIlIIlI

Introduction_bit_bit

Sep 9th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.  
  5.     int a = 3; // 0...0 0011
  6.     int b = 5; // 0...0 0101
  7.     int c = a & b; // 0...0 0001
  8.     int d = a | b; // 0...0 0111
  9.     int e = ~a; // 1...1 1100
  10.     int f = a ^ b; // 0...0 0110
  11.    
  12.     int g = a << 3; // η­‰εŒδΉ˜ 2^3
  13.     printf("%d", g);
  14. }
  15.  
  16. /*
  17.  
  18.   +  -
  19. + ++ +-
  20.  
  21. - -+ --
  22.  
  23.      000000000000000000101
  24.                     1
  25.                        
  26.  
  27. false & false = 0
  28. false & true = 0
  29. true & false = 0
  30. true & true = 1
  31.  
  32. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement