Data Types
- What is the value of p?
#include
using namespace std;
int main()
{
int res;
bool p = false;
bool q = true;
int num0 = 15;
int num1 = 10;
res = ((num0 | num1) + (p + q));
cout << res;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
16
- Evaluate the following
(false && true) || false || true
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
1
- What is the output of this program?
#include
using namespace std;
int main()
{
int k;
enum Month {
January = 1, February ,March, April, May, June, July, August, September, October, November, December
};
for (k = April; k <= September; k++)
cout << k;
return 0;
}
-
View Hint View Answer Discuss in Forum
None of these
Correct Option: A
We are getting the values from April to September and printing its concern number.
- What is the output of this program?
#include
using namespace std;
int main()
{
void num0 = 15, num1 = 16;
int num2;
num2 = num0 + num1;
cout << num2;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
void will not accept any values to its type.
- Identify the incorrect option.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Enumerators are used in order to create our own types whereas macros are textual substitutions.