Question
1.
#include
2.
#include
3.
#include
4.
using namespace std ;
5.
typedef list LISTSTR;
6.
int main()
7.
{
8.
LISTSTR :: iterator i;
9.
LISTSTR test;
10.
test.insert(test.end(), "one");
11.
test.insert(test.end(), "two");
12.
LISTSTR test2(test);
13.
LISTSTR test3(3, "three");
14.
LISTSTR test4(++test3.begin(),
15.
test3.end());
16.
cout
What is the output of this program?
1.
#include
2.
#include
3.
#include
4.
using namespace std ;
5.
typedef list LISTSTR;
6.
int main()
7.
{
8.
LISTSTR :: iterator i;
9.
LISTSTR test;
10.
test.insert(test.end(), "one");
11.
test.insert(test.end(), "two");
12.
LISTSTR test2(test);
13.
LISTSTR test3(3, "three");
14.
LISTSTR test4(++test3.begin(),
15.
test3.end());
16.
cout
Answer: Option D
Was this answer helpful ?
In this program, We used the list to manipulate the given value.
Output:
$ g++ std3.cpp
$ a.out
test: one
two
test: one
two
test: three
three
three
test: three
three
Was this answer helpful ?
Submit Solution