Bitwise Operators
Submissions: 4529   Accuracy:


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

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.

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

4 8 2


** 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, generate link and share the link here.

to report an issue on this page.