BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Free C++ Institute CPA-21-02 Exam Dumps December 2026

Here you can find all the free questions related with C++ Institute CPA - C++ Certified Associate Programmer Exam (CPA-21-02) exam. You can also find on this page links to recently updated premium files with which you can practice for actual C++ Institute CPA - C++ Certified Associate Programmer Exam . These premium versions are provided as CPA-21-02 exam practice tests, both as desktop software and browser based application, you can use whatever suits your style. Feel free to try the CPA - C++ Certified Associate Programmer Exam premium files for free, Good luck with your C++ Institute CPA - C++ Certified Associate Programmer Exam .
Question No: 1

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

#include

#include

using namespace std;

class complex{

double re, im;

public:

complex() : re(1),im(0.4) {}

complex operator?(complex &t);

void Print() { cout << re << " " << im; }

};

complex complex::operator? (complex &t){

complex temp;

temp.re = this?>re ? t.re;

temp.im = this?>im ? t.im;

return temp;

}

int main(){

complex c1,c2,c3;

c3 = c1 ? c2;

c3.Print();

}

Question No: 2

MultipleChoice

What will happen if the memory cannot be allocated?

Options
Question No: 3

MultipleChoice

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

Options
Question No: 4

MultipleChoice

What is the output of the program given below?

#include

using namespace std;

int main (int argc, const char * argv[])

{

int i=10;

{

int i=0;

cout<

}

{

i=5;

cout << i;

}

cout<

return 0;

}

Options
Question No: 5

MultipleChoice

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

#include

#include

using namespace std;

class A {

protected:

int y;

public:

int x, z;

A() : x(1), y(2), z(0) {}

A(int a, int b) : x(a), y(b) { z = x * y;}

void Print() { cout << z; }

};

class B : public A {

public:

int y;

B() : A() {}

B(int a, int b) : A(a,b) {}

void Print() { cout << z; }

};

int main () {

A b(2,5);

b.Print();

return 0;

}

Options
Question No: 6

MultipleChoice

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

#include

using namespace std;

#define DEF_A 0

int main(int argc, char *argv[]) {

cout << DEF_A;

return 0;

}

Options
Question No: 7

MultipleChoice

Which code, inserted at line 10, generates the output "2?1"?

#include

#include

using namespace std;

class A {

protected:

int y;

public:

int z;

};

//insert code here

public:

void set() {

y = 2;

z = 3;

}

void Print() { cout << y << z; }

};

int main () {

B b;

b.set();

b.z = ?1;

b.Print();

return 0;

}

Options

Save Cancel