πŸ“Š C++
Q. What is the value of z in the following C++ code snippet?
Code:
        #include <iostream>
        using namespace std;
        int main()
        {
            int z;
            bool a = true;
            bool b = false;
            int x = 10;
            int y = 5;
            z = ((x | y) + (a + b));
            cout << z;
            return 0;
        }
  • (A) 12
  • (B) 0
  • (C) 2
  • (D) 16
πŸ’¬ Discuss
βœ… Correct Answer: (D) 16

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
170
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
83%
Success Rate