Question 1 of 25
Hints left: 3
Q1
How many instances are allowed by map and set while inserting an element into container?
Q2
Which of the following(s) can be used to access the first element of a vector v?
Q3
What will be the output of the following C++ code? #include <iostream> #include <exception> using namespace std; void terminator() { cout << "terminate" << endl; } void (*old_terminate)() = set_terminate(terminator); class Botch { public: class Fruit {}; void f() { cout << "one" << endl; throw Fruit(); } ~Botch() { throw 'c'; } }; int main() { try { Botch b; b.f(); } catch(...) { cout << "inside catch(...)" << endl; } }
Q4
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int i; for (i = 0; i < 10; i++); { cout << i; } return 0; }
Q5
Which header file is required to use get() function?
Q6
Which of the following is a Modifying Sequence Operation?
Q7
Which of the following is correct about Functors?
Q8
How many iterators are needed for the defining a new container?
Q9
What is the correct function prototype of () operator overloading?
Q10
How many ways are there for constructing a bitset?
Q11
What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; int main () { string mys; char mya[20]= "Hello world"; mys = mya; cout << mys << '\n'; return 0; }
Q12
Composition is also a type of . . . . . . . . relationship.
Q13
What must be an operand of operator delete?
Q14
What header file is included to use array classes?
Q15
By using which operator does point to next element is represent in iterator?
Q16
What will be the output of the following C++ code? #include<iostream> #include<any> using namespace std; int main() { float val = 5.5; any var(val); cout<<var.type().name()<<endl; return 0; }
Q17
Which of the following is corect way of constructing bitset using binary string?
Q18
What is the use of type() function in any container?
Q19
Pick out the incorrect static function member in numeric limits.
Q20
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int var = -12; try { cout<<"Inside try\n"; if (var < 0) { throw var; cout<<"After throw\n"; } } catch (int var ) { cout<<"Exception Caught\n"; } cout<<"After catch\n"; return 0; }
Q21
What will be the output of the following C++ code? #include <iostream> using namespace std; void test(int x) { try { if (x > 0) throw x; else throw 'x'; } catch(int x) { cout<<"integer:"<<x; } catch(char x) { cout << "character:" << x; } } int main() { test(10); test(0); }
Q22
What do maps and sets support?
Q23
Pick out the correct statement about the override.
Q24
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int n = 15; for ( ; ;) cout << n; return 0; }
Q25
In which of the following relationship objects of related classes are strongly dependent?