Variables And Data Types In C Plus Plus - Study Mode

[#96] What is the value of the following 8-bit integer after all statements are executed? int x = 1
x = x << 7
x = x >> 7
Correct Answer

(D) Implementation defined

[#97] What will be the output of the following C++ code? #include <iostream>
using namespace std
int main()
{
int num = 0x20 + 020 + 20
cout << sizeof(num)<<'
'
return 0
}
Correct Answer

(C) Depends on compiler

[#98] What will be the output of the following C++ code? #include <iostream>
using namespace std
int main()
{
int a = 8
cout << "ANDing integer 'a' with 'true' :" << (a && true)
return 0
}
Correct Answer

(A) ANDing integer 'a' with 'true' :8

[#99] What is the correct way to declare a constant variable named 'PI' with a value of 3.14159 in C++?
Correct Answer

(D) const double PI = 3.14159

[#100] What is the output of the following code: cout << (7 >= 7)
in C++?
Correct Answer

(A) TRUE