Bitwise Operators
Submissions: 5989   Accuracy:

44.7%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Fork CPP   Placement 100

Bitwise operators are useful when we want to work with bits. Here, we'll take a look at them.

Given three positive integers a, b and c. Your task is to perform some bitwise operations on them as given below:
1. d = a ^ a
2. e = c ^ b
3. f = a & b
4. g = c | (a ^ a)
5. e = ~e
Note: ^ is for xor. The working of bitwise operators can be found here.

Input Format:
First line of input contains number of testcases. For each testcase, there will be single line containing a, b and c.

Output Format:
For each testcase, output the result of operations preformed in all the above given 5 steps in new line.

Constraints:
1 <= T <= 100
1 <= A, B, C <= 106

Example:
Input:
1
4 8 2

Output:
0
10
0
2
-11

Video:

** For More Input/Output Examples Use 'Expected Output' option **

Author: Dhiman Mayank


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.