Question: What output will be produced by the following program: #include #include using namespace std; int main ( ) { vector vectA = { 1 .

What output will be produced by the following program:
#include
#include
using namespace std;
int main()
{
vector vectA ={1.1,2.2,3.3,4.4}:
vector vectB(vectA);
cout << "Value of 'vectB[2]' is "<< vectB[2]<< endl;
return 0;
}
Question 32 options:
a)
Value of 'vectB[2]' is 2.2
b)
Value of 'vectB[2]' is nan
c)
Value of 'vectB[2]' is 3.3
d)
None, An error message reporting that the vector named 'vectB' was not initialized correctly will be displayed instead.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!