11. Which of these expressions will make the rightmost set bit zero in an input integer x?
12. Which of the following is a valid floating-point literal?
13. Identify the type of variables.
typedef char* CHAR;
CHAR p,q;
typedef char* CHAR;
CHAR p,q;14. Given the variables p, q are of char type and r, s, t are of int type. Select the right statement?
1. t = (r * s) / (r + s);
2. t = (p * q) / (r + s);
1. t = (r * s) / (r + s);
2. t = (p * q) / (r + s);15. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
float f1 = 0.5;
double f2 = 0.5;
if (f1 == 0.5f)
cout << "equal";
else
cout << "not equal";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
float f1 = 0.5;
double f2 = 0.5;
if (f1 == 0.5f)
cout << "equal";
else
cout << "not equal";
return 0;
}16. To which of these enumerators can be assigned?
17. Pick the right option.
Statement 1: A definition is also a declaration.
Statement 2: An identifier can be declared just once.
Statement 1: A definition is also a declaration.
Statement 2: An identifier can be declared just once.
18. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int g = 100;
int main()
{
int a;
{
int b;
b = 20;
a = 35;
g = 65;
cout << b << a << g;
}
a = 50;
cout << a << g;
return 0;
}
#include <iostream>
using namespace std;
int g = 100;
int main()
{
int a;
{
int b;
b = 20;
a = 35;
g = 65;
cout << b << a << g;
}
a = 50;
cout << a << g;
return 0;
}19. Identify the user-defined types from the following?
20. Identify the incorrect option.
Read More Section(Variables and Data Types in C plus plus)
Each Section contains maximum 100 MCQs question on Variables and Data Types in C plus plus. To get more questions visit other sections.
