c++ & operator

#include <iostream>

int main() {
    int x = 5;
    int y = 3;

    int result = x & y;

    std::cout << "Result: " << result << std::endl;

    return 0;
}
  1. Include the necessary header file <iostream>.

  2. Define the main function.

  3. Declare an integer variable x and initialize it with the value 5.

  4. Declare another integer variable y and initialize it with the value 3.

  5. Declare an integer variable result.

  6. Apply the bitwise AND operator (&) between x and y and assign the result to the variable result.

  7. Output the result using std::cout.

  8. Return 0 to indicate successful program execution.