1 Crore+ students have signed up on EduRev. Have you? Download the App |
For what values of the expression is an if-statement block not executed?
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int f(int p, int q)
{
if (p > q)
return p;
else
return q;
}
main()
{
int a = 5, b = 10;
int k;
bool x = true;
bool y = f(a, b);
k =((a * b) + (x + y));
cout << k;
}
Which of the two operators ++ and — work for the bool data type in C++?
What is the value of p in the following C++ code?
#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;
}