Question 11
EasyWhat is the output of this program?
#include <iostream>
using std;
{
x = ;
&r = x;
r = ;
cout << x;
;
}
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Programming Languages
What is the output of this program?
#include <iostream>
using std;
{
x = ;
&r = x;
r = ;
cout << x;
;
}
4
9
13
An address
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
cout << max(3, 7) << min(3, 7);
return 0;
}
77
37
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
using namespace std;
int main() {
bool b = true;
cout << b;
return 0;
}
b
true
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main() {
string s = "Hi";
s += "!";
cout << s;
return 0;
}
Hi
Hi!
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
using namespace std;
int main() {
int a[5] = {1, 2};
cout << a[4];
return 0;
}
1
Garbage value
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
using namespace std;
int main() {
for (int i = 3; i > 0; i--)
cout << i;
return 0;
}
3210
123
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
using namespace std;
int main() {
auto x = 5 + 2.5;
cout << x;
return 0;
}
8
7
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> v = {4, 2, 9};
sort(v.begin(), v.end());
cout << v[0];
return 0;
}
9
0
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
using namespace std;
int main() {
int x = 7;
cout << (x % 2 == 0 ? "even" : "odd");
return 0;
}
1
odd
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main() {
string s = "hello";
cout << s.substr(1, 3);
return 0;
}
ello
hel
Sign up free to see the answer and a step-by-step explanation.
73
10
0
1
Hi !
!Hi
2
0
321
21
7.5
5
2
4
even
0
el
ell