C++ Certified Professional Programmer (CPP) - CPPL Exam Questions
Last updated on June 20, 2026
using namespace std;
int main ()
int t|] = (1, 2,3,4,5, 6, 7, 8, 9, 10);
vector
dequesint>d1(t, t+10);
d1.empty();
v1.empty();
if (v1.isempty())
cout«"I am empty";
}
else
cout«<"I am not empty";
cout<
to join the discussion
No discussions yet. Be the first to ask!
Delete Comment
Are you sure? This action cannot be undone.
using namespace std;
template
ostream & out;
Out(ostream & o): out(o))
void operator ()(const T & val) {
out<
};
struct Sequence {
int start;
102/153 Sequence(int start): start(start/
int operator()(){
return start++;
};
int main() (
vector int 1(5);
generate(v1.begin(), v1.end(), Sequence(1));
set
deque
reverse(v1.begin(),v1.end());
reverse(s1.begin(), s1.end());
reverse(d1.begin(), d1.end());
for_each(v1.begin(), v1.end(), Outsint>(cout) );
for_each(s1.begin(), s1.end(), Out
for_each(d1.begin(), d1.end), Outsint>(cout) );cout<
Program outputs:
to join the discussion
No discussions yet. Be the first to ask!
Delete Comment
Are you sure? This action cannot be undone.
using namespace std;
class B {int val;
public: B(int v): val (v))
int getV() const (return val;} bool operator < (const B &
v) const { return val>v.val;} ];
ostream & operator «(ostream & out, const B &
v) { out<
ostream & out;
Out(ostream & o): out(o)(
void operator() (const T & val) { out<
B t1|= (3,2,4,1,5};
B t2[] = (5,6,8,2,1);
vector v1(10,0);
sort(t1, t1+5);
sort(t2, t2+5);
set_intersection(t1,t1+5,t2,t2+5,v1.begin());
for_each(v1.begin(), v1.end(), Out(cout));cout«
Program outputs:
to join the discussion
No discussions yet. Be the first to ask!
Delete Comment
Are you sure? This action cannot be undone.
using namespace std;
int main()
deque
priority_queue
to join the discussion
No discussions yet. Be the first to ask!
Delete Comment
Are you sure? This action cannot be undone.
using namespace std;
int main() (
int t[] = (1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5);
vector
set
pair‹set
cout‹‹*resultSet.first<"" «*resultSet.second‹
Program outputs:
to join the discussion
No discussions yet. Be the first to ask!
Delete Comment
Are you sure? This action cannot be undone.
Finish Practice?
Are you sure you want to finish? This will end your practice session.