What will be the result of the expression 5 & 3 in C++?
- 0
- 1
- 15
- 8
In C++, the '&' operator is a bitwise AND operator. When you perform a bitwise AND operation between 5 and 3 (binary 101 & 011), you get 001, which is decimal 1.
Loading...
Related Quiz
- Alex is developing a mathematical expression evaluator and wants to handle both unary and binary minus operators. Which consideration related to operator precedence should he keep in mind?
- You are working on a large-scale simulation software where numerous animal species are modeled. Which type of inheritance might be most suitable to model individual animal species without encountering the diamond problem?
- Imagine a scenario where you have to maintain a collection of elements while keeping them sorted after insertions and deletions. Which STL container would be the most efficient choice for this task?
- When an enum is declared, it creates a new _______.
- A game has a scoring system where players earn points. The game needs a feature to evenly distribute bonus points among players and also determine any remaining points that can't be evenly distributed. Which arithmetic operator is essential to determine the number of leftover points?