Answers for "bitwise operators in c"

C
0

bitwise operators in c

~  ==> bitwise NOT
&  ==> bitwise AND
|  ==> bitwise OR
^  ==> bitwise XOR
>> ==> bit shift right
<< ==> bit shift left
Posted by: Guest on September-10-2021
1

bitwise operator

bitwise complement of N = ~N (represented in 2's complement form)
2'complement of ~N= -(~(~N)+1) = -(N+1)
Posted by: Guest on September-24-2020
0

bitshift c

i = 14; // Bit pattern 00001110
j = i >> 1; // here we have the bit pattern shifted by 1 thus we get 00000111 = 7 which is 14/2
Posted by: Guest on January-04-2021
0

C bitwise

#include <stdio.h>
int main(void) {
  unsigned int a = 60; //Equal to: 0011 1100
  unsigned int b = 13 // Equal to: 0000 1101
  
  int both = a & b //If both are 0, then its a 0, 
  // if both are 1, then its a 1.  //0000 1100
  
  printf("%d\n", both);


}
Posted by: Guest on May-18-2021
0

bitwise operator

12 = 00001100 (In Binary)
25 = 00011001 (In Binary)

Bit Operation of 12 and 25
  00001100
& 00011001
  ________
  00001000  = 8 (In decimal)
Posted by: Guest on September-24-2020

Code answers related to "bitwise operators in c"

Code answers related to "C"

Browse Popular Code Answers by Language