What is the value of p in the following C++ code snippet? #include <iostream>…
BPSC TRE 2023Modified — slightly modified from the official paper; see the solution
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; }
- A.
12
- B.
16
- C.
2
- D.
More than one of the above
- E.
None of the above
Attempted by 280 students.
Sign up free to check your answer
Sign up freeLoading lesson…

