Advertisement
Tahamina_Taha

Bitwise operator

Aug 19th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. //operations performed on a bit level using bitwise operators.
  4.  
  5. {
  6.  
  7.     int a,b,c;
  8.     printf("enter two number :\n");
  9.     scanf("%d%d",&a,&b);
  10.     c=a&b;// multiplication
  11.     printf("a&b = %d\n",c);
  12.     c=a|b;// addition
  13.     printf("a|b = %d\n",c);
  14.     c=a^b;
  15.     printf("a^b = %d\n",c);//The result of XOR is 1 if the two bits are different
  16.    
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement