What does this symbol mean '&'?
Non Verbal Reasoning
Analytical Reasoning
Difficulty: Medium
Choose an option
Answer
Correct Answer: Bitwise AND operator
Explanation
The symbol & in programming languages like C and C++ is primarily used as the bitwise AND operator.
- Bitwise AND compares each bit of two numbers and returns a new number with bits set to 1 only if both bits were 1.
- For example:
5 & 3results in1because:
5 = 1013 = 011& = 001 → 1
Note: In C/C++, the & symbol is also used as the "address-of" operator in certain contexts, but unless specified otherwise, the standard meaning is bitwise AND.