Exclusive Black Friday Deal: 70% Off All Exam Bundles! Use coupon code below to unlock your savings! - Ends in 0d 00h 00m 00s - Coupon code: Friday70

Free Beingcert Certified Python Programmer Exam Practice Questions

Question # 1

What happens when you attempt to compile and run the following code?

#include

#include

#include

using namespace std;

int main () {

int t[] = {1,2,3,4,5,1,2,3,5,4};

vector v (t,t+10);

vector::iterator it;

int m1[] = {1, 3, 2};

it = find_end (v.begin(), v.end(), m1, m1+3);

if (it != v.end())

cout << "Found at position: " << it?v.begin() << endl;

return 0;

}

Options:

A.  

program outputs: Found at position: 5

B.  

program outputs: Found at position: 0

C.  

no output

D.  

program outputs: Found at position: 10

Discussion 0
Question # 2

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: true false?

#include

#include

using namespace std;

int main ()

{

bool a,b;

cin>>boolalpha>>a>>b;

cout<

return 0;

}

Program will output:

Options:

A.  

truefalse

B.  

true0;

C.  

1false

D.  

10

E.  

none of these

Discussion 0
Question # 3

What happens when you attempt to compile and run the following code?

#include

#include

int main ()

{

int t[]={1,2,3,4,5};

std::vectorv1(t,t+5);

std::vectorv2(v1);

v1.resize(10);

v2.reserve(10);

std::vector::iterator i = v1.begin();int ii = 0;

while (i != v1.end()) { std::cout<

i = v2.begin();ii=0;

while (i != v2.end()) { std::cout<

return 0;

}

Options:

A.  

program outputs 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B.  

compilation error

C.  

program outputs 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5

D.  

program outputs 1 2 3 4 5 0 0 0 0 0 1 2 3 4 5 0 0 0 0 0

Discussion 0
Question # 4

What happens when you attempt to compile and run the following code?

#include

#include

#include

using namespace std;

int main ()

{

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

vector v1(t, t + 10);

deque d1(v1.begin(), v1.end());

deque d2;

d2 = d1;

d2.insert(d1.rbegin(), 10);

for(int i = 0; i

{

cout<

}

return 0;

}

Options:

A.  

program outputs: 0 1 2 3 4 5 6 7 8 9 10

B.  

program outputs: 10 0 1 2 3 4 5 6 7 8 9

C.  

program outputs: 0 1 2 3 4 5 6 7 8 9

D.  

compilation error

Discussion 0
Question # 5

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 64 100?

#include

#include

#include

#include

using namespace std;

int main ()

{

string s;

getline(cin, s);

stringstream input(s);

stringstream output;

for( ; !input.fail() ; )

{

int i;

input>>hex>>i;

output<

}

cout<

return 0;

}

What will be the result assuming that user will enter following sequence: 64 100:

Options:

A.  

64 100

B.  

100 256

C.  

100 256 256

D.  

0x64 0x100

E.  

0x100 0x256 0x256

Discussion 0
Question # 6

What happens when you attempt to compile and run the following code?

#include

#include

using namespace std;

template

class A {

T_v;

public:

A() {}

A(T v): _v(v){}

T getV() { return _v; }

void add(T & a) { _v+=a; }

void add(string & a) {

_v.insert(0, a);

}

};

int main()

{

Aa("Hello");

string s(" world!");

a.add(s);

cout << a.getV() <

return 0;

}

Options:

A.  

program will display: Hello world!

B.  

compilation error

C.  

program will display: world!Hello

D.  

program will run without any output

Discussion 0
Question # 7

What happens when you attempt to compile and run the following code?

#include

#include

#include

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

ostream & operator <<(ostream & out, const B & v) { out<

templatestruct Out {

ostream & out;

Out(ostream & o): out(o){}

void operator() (const T & val ) { out<

int main() {

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

deque d1(t, t+10);

sort(d1.begin(), d1.end());

deque::iterator it = upper_bound(d1.begin(), d1.end(), B(4), greater());

for_each(it, d1.end(), Out(cout)); cout<

return 0;

}

Program outputs:

Options:

A.  

5 6 7 8 9 10

B.  

4 5 6 7 8 9 10

C.  

compilation error

D.  

1 2 3 4 5

E.  

1 2 3 4

Discussion 0
Question # 8

What happens when you attempt to compile and run the following code?

#include

#include

#include

#include

#include

using namespace std;

int main()

{

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

deque mydeck(t, t+10);list mylist(t,t+10);

queue first;

queue second(mydeck);

queue third(second);

queue > fourth(mylist);

mylist.clear();third.clear();

cout<

cout<

return 0;

}

Options:

A.  

program outputs: 10 0

10 0

B.  

program outputs: 0 0

0 0

C.  

program outputs: 10 10

10 10

D.  

program outputs: 10 0

0 10

E.  

compilation error

Discussion 0
Question # 9

What happens when you attempt to compile and run the following code?

#include

#include

#include

using namespace std;

templatestruct Out {

ostream & out;

Out(ostream & o): out(o){}

void operator() (const T & val ) { out<

int main() {

int t1[]={3,2,4,1,5};

int t2[]={5,6,8,2,1};

vector v1(10);

sort(t1, t1+5);

sort(t2, t2+5);

set_union(t1,t1+5,t2,t2+5,v1.begin());

for_each(v1.begin(), v1.end(), Out(cout));cout<

return 0;

}

Program outputs:

Options:

A.  

3 2 4 1 5 6 8 2 1 0

B.  

1 2 3 4 5 6 8 2 1 0

C.  

1 1 2 2 3 4 5 5 6 8

D.  

1 2 3 4 5 6 8 0 0 0

E.  

compilation error

Discussion 0
Question # 10

What will happen when you attempt to compile and run the code below, assuming that file test.in contains the following sequence: 1 2 3?

#include

#include

#include

#include

#include

using namespace std;

templatestruct Out {

ostream & out;

Out(ostream & o): out(o){}

void operator() (const T & val ) {out<

int main () {

ifstream f("test.in");

list l;

for( ; f.good() ; ) {

int i;

f>>i;

l.push_back(i);

}

f.close();

for_each(l.begin(), l.end(), Out(cout));

return 0;

}

Program will output:

Options:

A.  

1 2 3

B.  

1 2 3 3

C.  

no output

D.  

compilation error

E.  

program runs forever without output

Discussion 0

CPP PDF

CPP PDF (Printable)
$180
$600

CPP Testing Engine

CPP PDF (Printable)
$180
$600

CPP PDF + Testing Engine

CPP PDF (Printable)
Exams4sure Dumps

Exam style questions across every CPP domain

Last Update 5 hours ago
Total Questions : 0

Start with our free CPP practice questions, carefully crafted to mirror the domains, phrasing, and difficulty of the real Certified Python Programmer exam. Each CPP exam question comes with a detailed rationale that explains not just which answer is correct but why the others fall short. That's how concepts stick. Use the free set to benchmark yourself: identify your Python Programming weak domains, see where you're losing marks, and build a focused study plan in minutes.

Free Exams Sample Questions

  • We Accept

    exams4sure payments accept


    Secure Site

    mcafee secure

    TESTED 20 Nov 2026

  • Customer Review

    I was overwhelmed by the amount of material I had to cover, but Exams4sure's practice questions were incredibly close to the real exam. I studied for three weeks and passed with confidence. Highly recommend it to anyone short on time!

    exams4sure customer reviews
    Ivy Rose Happy Customer
  • Quality Commitment

    We don't just sell practice tests, we deliver results. Our material is carefully crafted to cover exactly what you need, so even with a tight schedule, you can prepare effectively and pass with confidence. If it doesn't meet your expectations, we're only a message away, your success and satisfaction come first.