1.
What does STL stand for?
(a) Simple Template Library
(b) Standard Template Library
(c) Static Type Library
(d) Single Type¬based Library
2.
STL is based on which of the following programming paradigms?
(a) Structured Programming
(b) Object Oriented Programming (OOP)
(c) Functional Programming
(d) Aspect Oriented Programming (AOP)
3.
Which of the STL containers store the elements contiguously (in adjecent memory locations)?
(a) std::vector
(b) std::list
(c) std::map
(d) std::set
4.
Find the output of this:
#include
using namespace std;
main()
{
char s= “hello”,
t = “hello”;
if (s = = t)
Cout<<“equal strings”;
}
(a) Equal strings
(b)Unequal strings
(c) No output
(d) Compilation error
5.
What kind of iteration does forward_list provide in C++?
(a) Uni-directional
(b) Bi-directional
(c) Multi-directional
(d) None of the mentioned
6.
What does the size of the vector refers to in c++?
(a) Size of vector
(b) Type of vector
(c) Number of elements
(d) None of the mentioned
7.
What is the use of adapter in STL in c++?
(a) To provide interface
(b) To manipulate the data
(c) To extract the data
(d) None of the mentioned
8.
What is the output of this program?
#include
#include
using namespace std;
int main ()
{
Vector < int > myvector;
myvector.push_back (78);
myvector.push_back (16);
myvector. Front () += myvector. Back ();
Cout << myvector. Front () << ‘\n’;
return 0;
}
(a) 78
(b) 16
(c) 94
(d) None of the mentioned
In this program, we added all the values in the vector by using front and back operation.
Output:
$ g++ seqc1.cpp
$ a.out
94.
9.
Which is used to iterate over container?
(a) Associated iterator type
(b) Data type of objects
(c) Return type of variables
(d) None of the mentioned
10.
Which is not C++ storage class
(a) auto
(b) register
(c) static
(d) iostream
Storage classes are:
auto
register
static
extern