Variables And Data Types In C Plus Plus - Study Mode
[#86] Choose the correct option. extern int i
int i
Correct Answer
(D) 1 declares i,2 declares and defines i
[#87] What will be the output of the following C++ code? #include <iostream>
using namespace std
int main()
{
int x = -1
unsigned int y = 2
if(x > y)
{
cout << "x is greater"
}
else
{
cout << "y is greater"
}
}
Correct Answer
(A) x is greater
[#88] What will be the output of the following C++ code? #include <iostream>
using namespace std
void addprint()
{
static int s = 1
s++
cout << s
}
int main()
{
addprint()
addprint()
addprint()
return 0
}
Correct Answer
(A) 234
[#89] 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
}
Correct Answer
(B) 16
[#90] 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
}
Correct Answer
(C) 52