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;
}
What will happen when you attempt to compile and run the following code? Choose all possible answers.
#include
using namespace std;
class B {};
template
class A {
T_v;
public:
A() {}
A(T v): _v(v){}
T getV() { return _v; }
void add(T a) { _v+=a; }
};
int main()
{
A
Ab;
a.add(10);
cout << a.getV() < return 0; }
What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 64 100
#include
#include
#include
#include
using namespace std;
int main ()
{
string s;
getline(cin, s);
stringstream input(s);
stringstream output;
for( ; !input.fail() ; )
{
int i;
input>>hex>>i;
output< } cout< return 0; } What will be the result assuming that user will enter following sequence: 64 100:
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 ostream & operator <<(ostream & out, const B & v) { out< template ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< int main() { int t[]={8, 10, 5, 1, 4, 6, 2, 7, 9, 3}; vector v1(t, t+10); sort(v1.begin(), v1.end(), greater()); for_each(v1.begin(), v1.end(), Out(cout));cout< return 0; } Program outputs:
Sharon Garcia
10 days agoEmi Hoang
16 days agoPatricia Lee
1 month agoNicolas Sidorov
2 months agoSharon Hall
2 months agoMatthew Morris
3 months agoKaren Hernandez
4 months agoEmma Reed
3 months agoJoseph Harris
3 months agoNancy Bailey
3 months agoWilliam Gonzalez
3 months agoAndrew Nguyen
3 months agoLoise
4 months agoKyoko
4 months agoDevora
5 months agoCarlota
5 months agoFletcher
5 months agoMajor
5 months agoGwen
6 months agoKris
6 months agoDonte
6 months agoKimberlie
6 months agoMarquetta
7 months agoGlory
7 months agoFatima
7 months agoOmega
7 months agoKristin
8 months agoPaz
8 months agoRose
8 months agoMarge
8 months agoGail
9 months agoDaren
9 months agoTarra
9 months agoFannie
9 months agoPearlie
10 months agoDonte
10 months agoSilva
10 months agoGiuseppe
10 months agoAileen
11 months agoSabra
11 months agoAnnmarie
11 months agoBuffy
1 year agoDyan
1 year agoSalena
1 year 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