BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute Exam CPP Topic 7 Question 38 Discussion

Actual exam question for C++ Institute's CPP exam
Question #: 38
Topic #: 7
[All CPP Questions]

Which changes introduced independently will allow code to compile and display 0 1 8 9 (choose all that apply)

#include

#include

#include

using namespace std;

class A {

int a;

public:

A(int a):a(a){}

int getA() const { return a;}

/* Insert Code Here 1 */

};

/* Insert Code Here 2 */

int main(){

A t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };

vectorv(t, t+10);

set s1(v.begin(),v.end());

s1.insert(v.begin(),v.end());

s1.erase(s1.lower_bound(2),s1.upper_bound(7));

for(set::iterator i=s1.begin();i!= s1.end(); i++) {

cout<getA()<<" ";

}

cout<

return 0;

}

Show Suggested Answer Hide Answer
Suggested Answer: A, B, D

Contribute your Thoughts:

Currently there are no comments in this discussion, be the first to comment!


Save Cancel