C# Programming - Operators - Discussion

Discussion Forum : Operators - General Questions (Q.No. 14)
14.
Which of the following statements is correct about Bitwise | operator used in C#.NET?
The | operator can be used to put OFF a bit.
The | operator can be used to Invert a bit.
The | operator can be used to check whether a bit is ON.
The | operator can be used to check whether a bit is OFF.
The | operator can be used to put ON a bit.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
5 comments Page 1 of 1.

Abhishek yadav said:   1 decade ago
@Kalaiselvan here is your answer for bitwise | (or) operator 1+1=1, 1+0=1 and 0+0=0.

So if we want to make a bit on for always we can use 'or' operator by which when ever we apply 1 or 0, in both cases it with produce one because our required bit is already in one state.

Sumit Sharma said:   1 decade ago
1 & 1 = 1 i.e. ON it makes sense here. Both of the bit is ON then Then results comes ON.

Darshana said:   1 decade ago
Please tell which operator is | ?

Abhishek yadav said:   1 decade ago
| is bitwise 'or' operator.

Kalaiselvan said:   1 decade ago
Explain how it is ?

Post your comments here:

Your comments will be displayed after verification.