What is the value of ‘p’ in the following C++ code snippet? #include…

What is the value of ‘p’ in the following C++ code snippet? #include <iostream> using namespace std; int main() { int p; bool a = true; bool b = false; int x = 10; int y = 5; p = (x || y) + (a + b); cout << p; return 0; }

  1. A.

    12

  2. B.

    16

  3. C.

    2

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 642 students.

Sign up free to check your answer

Sign up free

Explore the full course: Bpsc

Loading lesson…