Q441
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
1,008
Questions
23/51
Page
Pick an option on a question to see the right answer and solution.
Q441
Open questionSelect an option to see the answer and solution.
Q442
Open questionSelect an option to see the answer and solution.
Q443
Open questionSelect an option to see the answer and solution.
Q444
Open question#include <iostream>
#include <map>
using namespace std;
int main ()
{
try {
map<char, int> mymap;
map<char, int> :: iterator it;
mymap['a'] = 50;
mymap['b'] = 100;
mymap['c'] = 150;
mymap['d'] = 200;
it = mymap.find('b');
mymap.erase (it);
mymap.erase (mymap.find('d'));
cout << mymap.find('a') -> second << '\n';
}
catch (...)
{
cout << "Unknown exception: " << endl;
}
return 0;
}Select an option to see the answer and solution.
Q445
Open question#include <iostream>
using namespace std;
class BaseClass
{
public:
virtual void myFunction()
{
cout << "1";
}
};
class DerivedClass1 : public BaseClass
{
public:
void myFunction()
{
cout << "2";
}
};
class DerivedClass2 : public DerivedClass1
{
public:
void myFunction()
{
cout << "3";
}
};
int main()
{
BaseClass *p;
BaseClass ob;
DerivedClass1 derivedObject1;
DerivedClass2 derivedObject2;
p = &ob;
p -> myFunction();
p = &derivedObject1;
p -> myFunction();
p = &derivedObject2;
p -> myFunction();
return 0;
}Select an option to see the answer and solution.
Q446
Open question#include <iostream>
#include <cctype>
using namespace std;
int main(int argc, char const *argv[])
{
char arr[12] = "H3ll0\tW0r1d";
for(int i=0;i<12;i++)
{
cout<<(bool)isprint(arr[i]);
}
}Select an option to see the answer and solution.
Q447
Open questionSelect an option to see the answer and solution.
Q448
Open questionSelect an option to see the answer and solution.
Q449
Open questionSelect an option to see the answer and solution.
Q450
Open question#include <iostream>
#include <bitset>
using namespace std;
int main()
{
bitset<8> b1(20);
cout<<b1.test(1);
cout<<b1.test(2);
}Select an option to see the answer and solution.
Q451
Open questionSelect an option to see the answer and solution.
Q452
Open questionSelect an option to see the answer and solution.
Q453
Open questionSelect an option to see the answer and solution.
Q454
Open questionSelect an option to see the answer and solution.
Q455
Open questionSelect an option to see the answer and solution.
Q456
Open question#include <iostream>
using namespace std;
int main ()
{
int n;
for (n = 5; n > 0; n--)
{
cout << n;
if (n == 3)
break;
}
return 0;
}Select an option to see the answer and solution.
Q457
Open question#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
int myints[] = {2, 4, 6, 8, 10};
vector<int> v(myints, myints + 5);
make_heap (v.begin(),v.end());
cout << v.front() << '\n';
return 0;
}Select an option to see the answer and solution.
Q458
Open questionSelect an option to see the answer and solution.
Q459
Open questionSelect an option to see the answer and solution.
Q460
Open questionSelect an option to see the answer and solution.