C++ Certified Professional Programmer (CPP) - CPPL Exam Questions
Last updated on June 20, 2026
using namespace std;
template
void f(A &a)
cout<<1‹
course sendi int main()
int a = 1;
f(a);
return O;
}
to join the discussion
No discussions yet. Be the first to ask!
Delete Comment
Are you sure? This action cannot be undone.
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) { out<
Out(ostream & o): out(o)0)
void operator() (const T & val ) {out<
int t[]=(8, 10, 5, 1, 4, 6, 2, 7, 9, 3);
set s1(t, t+10);
sort(s1.begin(), s1.end());
for_each(s1.begin(), s1.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;
class A { int a; public:
A(int a)( this?>a=a;}
//insert code here 1
};
//insert code here 2
template
while (start!= end) {
std::cout «*start <<""; start++;
}
int main() f
A t1[] =(1, 7, 8, 4, 5 };list [1(t1, t1 + 5);
A t2[] = ( 3, 2, 6, 9, 0 };list 12(t2, t2 + 5);
11.sort();12.sort();|1.merge(12);
print(|1.begin(), 11.end());
print(I2.begin(), I2.end()); cout<
}
28/153
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=0): val(v))
int getV) const (return val;}
operator int() const ( return val; };);
template
ostream & out;
Out(ostream & o): out(o))
void operator() (const T & val) {out‹
int t[] = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
fstream f("test.out", ios:: trunc|ios::out);
list |(t, t+10);
for_each(l.begin(), I.end(), Out(f));
f.close();
f.open("test.out");
for good):/{
int i;
f>>i;
cout«i«""';
f.close();
return O;
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.