What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: one two three
#include
#include
using namespace std;
int main ()
{
string a;
cin>>a;
cout< return 0; } Program will output:
Which sentence is correct about the code below?
#include
#include
#include
using namespace std;
class A {
int a;
public:
A(int a) : a(a) {}
int getA() const { return a; }
void setA(int a) { this?>a = a; }
/* Insert Code Here */
};
struct add10 { void operator()(A & a) { a.setA(a.getA() + 10); } };
int main() {
int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 };
vector v1(t, t + 10);
for_each(v1.begin(), v1.end(), add10());
vector::iterator it = find(v1.begin(), v1.end(), A(7));
cout << it?>getA() << endl;
return 0;
}
What will happen when you attempt to compile and run the following code?
#include
#include
#include
#include
#include
using namespace std;
int main() {
int t[] = { 3, 4, 2, 1, 0, 3, 4, 1, 2, 0 };
vector
multimap
for (vector
stringstream s;s << *i << *i;
m.insert(pair
}
pair
range = m.equal_range(2);
for (multimap
cout << i?>first << " ";
}
return 0;
}
The output will be:
What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
class B { int val;
public:
B(int v):val(v){}
int getV() const {return val;} bool operator > (const B & v) const { return val>v.val;} };
ostream & operator <<(ostream & out, const B & v) { out< template ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< int main() { B t[]={3,2,4,1,5,10,9,7,8,6}; vector v1(t,t+10); sort(v1.begin(), v1.end(), greater()); cout<<*min_element(v1.begin(), v1.end()); return 0; } Program outputs:
Which stack initialization (line numbers) are correct? Choose all that apply.
#include
#include
#include
#include
#include
using namespace std;
int main()
{
deque
list
vector
stack
stack
stack
stack
stack
return 0;
}
Fatima Nawaz
19 days agoLisa Rodriguez
1 month agoHyun Kim
2 months agoSharon Garcia
3 months agoEmi Hoang
3 months agoPatricia Lee
4 months agoNicolas Sidorov
4 months agoSharon Hall
5 months agoMatthew Morris
5 months agoKaren Hernandez
6 months agoEmma Reed
6 months agoJoseph Harris
5 months agoNancy Bailey
6 months agoWilliam Gonzalez
5 months agoAndrew Nguyen
6 months agoLoise
6 months agoKyoko
7 months agoDevora
7 months agoCarlota
7 months agoFletcher
7 months agoMajor
8 months agoGwen
8 months agoKris
8 months agoDonte
8 months agoKimberlie
9 months agoMarquetta
9 months agoGlory
9 months agoFatima
9 months agoOmega
10 months agoKristin
10 months agoPaz
10 months agoRose
10 months agoMarge
11 months agoGail
11 months agoDaren
11 months agoTarra
11 months agoFannie
12 months agoPearlie
12 months agoDonte
1 year agoSilva
1 year agoGiuseppe
1 year agoAileen
1 year agoSabra
1 year agoAnnmarie
1 year agoBuffy
1 year agoDyan
1 year agoSalena
2 years agoSalley
2 years agoArlean
2 years agoCaren
2 years agoAleisha
2 years agoLanie
2 years agoJohnetta
2 years agoChristiane
2 years agoStanford
2 years agoYuette
2 years agoDallas
2 years agoIndia
2 years agoAleisha
2 years agoRoselle
2 years agoVincenza
2 years agoLyda
2 years agoNoah
2 years agoMammie
2 years agoThea
2 years agoArlean
2 years agoMargarita
2 years ago