Evaluate the following
(false && true) || false || true
What is the value of p?
1. #include2. using namespace std; 3. int main() 4. { 5. int p; 6. bool a = true; 7. bool b = false; 8. int x = 10; 9. int y = 5; 10. p = ((x | y) + (a + b)); 11. cout << p; 12. return 0; 13. }
What is the output of the following program?
1. #include2. using namespace std; 3. int f(int p, int q) 4. { 5. if (p > q) 6. return p; 7. else 8. return q; 9. } 10. main() 11. { 12. int a = 5, b = 10; 13. int k; 14. bool x = true; 15. bool y = f(a, b); 16. k =((a * b) + (x + y)); 17. cout << k; 18. }
Which of the two operators ++ and - work for the bool datatype in C++?
For what values of the expression is an if-statement block not executed?