Question: Which line in the below code causes an error? #include #include using namespace std; int main ( ) { vector idNums ( 5 ) ;

Which line in the below code causes an error?
#include #include using namespace std; int main(){ vector idNums(5); idNums.at(1)=60; idNums.at(2)=70; idNums.at(3)=82; idNums.at(4)=90; idNums.at(5)=92; cout << "Size: "<< idNums.size()<< endl; idNums.push_back(2); cout << "New size: "<< idNums.size()<< endl; return 0; }
Group of answer choices
cout << "New size: "<< idNums.size()<< endl;
return 0;
idNums.at(5)=92;
cout << "Size: "<< idNums.size()<< endl;

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!