Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
vector first;
7.
first.assign (7,100);
8.
vector::iterator it;
9.
it=first.begin()+1;
10.
int myints[] = {1776,7,4};
11.
cout
Options:
A .  10
B .  9
C .  8
D .  7
Answer: Option D

In this program, We are finding the size of the vector elements and resizing it.
Output:
$ g++ vect3.cpp
$ a.out
7



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers