Question 1 of 25
Hints left: 3
Q1
Which of the header file is used for array type manipulation?
Q2
Which is used to describe the function using placeholder types?
Q3
What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; int main() { cout<<extent<remove_extent<string[10][20]>::type>::value; cout<<extent<remove_extent<string[10][20][30]>::type>::value; return 0; }
Q4
What will be the output of the following C++ code? #include<iostream> #include<iterator> #include<vector> using namespace std; int main() { vector<int> ar = { 1, 2, 3, 4, 5 }; vector<int>::iterator ptr = ar.begin(); ptr = next(ptr, 3); cout << *ptr << endl; return 0; }
Q5
What is the correct statement about lambda expression?
Q6
Which type of relationship is modelled by Association?
Q7
What is the name of the myfile2 file after executing the following C++ code? #include <stdio.h> int main () { int result; char oldname[] = "myfile2.txt"; char newname[] = "newname.txt"; result = rename(oldname, newname ); if (result == 0) puts ( "success" ); else perror( "Error" ); return 0; }
Q8
What will be the output of the following C++ code? #include <iostream> using namespace std; class Test1 { }; class Test2 : public Test1 { }; void Funct(); int main() { try { Funct(); } catch (const Test1&) { cerr << "Caught a exception" << endl; } return 0; } void Funct() { throw Test2(); }
Q9
Which algorithm is used in subtract_with_carry_engine?
Q10
What will be the output of the following C++ code? #include <iostream> #include <exception> using namespace std; struct MyException : public exception { const char * what () const throw () { return "C++ Exception"; } }; int main() { try { throw MyException(); } catch(MyException& e) { cout << "Exception caught" << std::endl; cout << e.what() << std::endl; } catch(std::exception& e) { } }
Q11
What will be the output of the following C++ code? #include <iostream> using namespace std; template <typename T, typename U> void squareAndPrint(T x, U y) { cout << x << x * x << endl; cout << y << " " << y * y << endl; }; int main() { int ii = 2; float jj = 2.1; squareAndPrint<int, float>(ii, jj); }
Q12
Which operator is used to allocate the memory?
Q13
What are binary functors?
Q14
What is the syntax of class template?
Q15
What will be the output of the following C++ code? #include <iostream> #include <utility> using namespace std; int main () { pair <int,int> p(1,2); cout<<"Pair(first,second) = ("<<p.first<<","<<p.second<<")\n"; return 0; }
Q16
In nested try-catch block, if the inner catch block gets executed, then . . . . . . . .
Q17
What is meant by permutation in c++?
Q18
What will be the output of the following C++ code? #include <iostream> #include <algorithm> #include <vector> using namespace std; int main () { vector<int> myvector (5); fill (myvector.begin(), myvector.begin() + 4, 5); fill (myvector.begin() + 3,myvector.end() - 2, 8); for (vector<int> :: iterator it = myvector.begin(); it != myvector.end(); ++it) cout << ' ' << *it; return 0; }
Q19
Where does the vector add the item?
Q20
Which of the follwoing function(s) of Array classes are similar to [] operator?
Q21
What is the use of swap() function in array class?
Q22
What will be the output of the following C++ code? #include <iostream> #include <utility> #include <string> using namespace std; int main () { pair <int,int> p1(1,2); pair <int,int> p2(3,4); cout<<"Pair(first,second) = ("<<p1.first<<","<<p1.second<<")\n"; p1.swap(p2); cout<<"Pair(first,second) = ("<<p1.first<<","<<p1.second<<")\n"; return 0; }
-
A
-
B
-
C
-
D
Q23
Which operators are used in the free store?
Q24
Why do we need relationships between classes?
Q25
Which operator is used to create the user-defined streams in c++?