C# Programming - Operators - Discussion
Discussion Forum : Operators - General Questions (Q.No. 2)
2.
What will be the output of the C#.NET code snippet given below?
byte b1 = 0xF7;
byte b2 = 0xAB;
byte temp;
temp = (byte)(b1 & b2);
Console.Write (temp + " ");
temp = (byte)(b1^b2);
Console.WriteLine(temp);
Discussion:
33 comments Page 1 of 4.
Veni said:
1 decade ago
Hi please tell me how its work.
Rohit said:
1 decade ago
Please explain all steps and it's working rule.
Abhijit Marne said:
1 decade ago
11110111 & 10101011 = 10100011 ie 163
11110111 | 10101011 = 01011100 ie 92
11110111 | 10101011 = 01011100 ie 92
Kavitha said:
1 decade ago
I couldn't understand that how it works. Please explain the steps.
Vakul Saini said:
1 decade ago
Please please give me the description how is this 163 92 ?
Sruthi said:
1 decade ago
(0xF7)its in hexadecimal lang convert it into binary then value is 11110111 similarly (0xAB)value is 10101011.
Add these two numbers you will get the value as 10100011 ie binary value convert into decimal ie 163, and
Subtract those two numbers you get the value as 01011100 decimal value is 92.
Add these two numbers you will get the value as 10100011 ie binary value convert into decimal ie 163, and
Subtract those two numbers you get the value as 01011100 decimal value is 92.
Bhairav said:
1 decade ago
Its right.
Gggggg said:
1 decade ago
Thank you bhairav!
Bhavik said:
1 decade ago
Thank you sruti
Anandhajothi.s said:
1 decade ago
How to work this problem ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers