Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- //operations performed on a bit level using bitwise operators.
- {
- int a,b,c;
- printf("enter two number :\n");
- scanf("%d%d",&a,&b);
- c=a&b;// multiplication
- printf("a&b = %d\n",c);
- c=a|b;// addition
- printf("a|b = %d\n",c);
- c=a^b;
- printf("a^b = %d\n",c);//The result of XOR is 1 if the two bits are different
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement