Variables And Data Types In C Plus Plus - Study Mode
[#81] 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
}
Correct Answer
(A) 2035655065
[#82] What is the data type of the variable 'x' in the following declaration: double x = 3.14
?
Correct Answer
(B) double
[#83] What will be the output of the following code: cout << (true && false)
in C++?
Correct Answer
(B) FALSE
[#84] What will be the output of the following C++ code? #include <iostream>
using namespace std
int main()
{
int a = 10
if (a < 10)
{
for (i = 0
i < 10
i++)
cout << i
}
else
{
cout << i
}
return 0
}
Correct Answer
(D) error
[#85] What will be the output of the following C++ code? #include <iostream>
using namespace std
int main()
{
float i = 123.0f
cout << i << endl
return 0
}
Correct Answer
(C) 123