C++ Institute - Big Savings Alert – Don’t Miss This Deal - Ends In 1d 00h 00m 00s Coupon code: 26Y30OFF
  1. Home
  2. C++ Institute
  3. CPA-21-02 Exam
  4. Free CPA-21-02 Questions

Free Practice Questions for C++ Institute CPA-21-02 Exam

Pass4Future also provide interactive practice exam software for preparing C++ Institute CPA - C++ Certified Associate Programmer (CPA-21-02) Exam effectively. You are welcome to explore sample free C++ Institute CPA-21-02 Exam questions below and also try C++ Institute CPA-21-02 Exam practice test software.

Page:    1 / 14   
Total 257 questions

Question 1

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

#include

using namespace std;

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

{

enum state { ok, error, warning};

enum state s1, s2, s3;

s1 = ok;

s2 = warning;

s3 = error;

s4 = ok;

cout << s1<< s2<< s3;

return 0;

}



Answer : B


Question 2

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

#include

#include

using namespace std;

class complex{

double re;

double im;

public:

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

bool operator==(complex &t);

};

bool complex::operator == (complex &t){

if((this?>re == t.re) && (this?>im == t.im))

return true;

else

return false;

}

int main(){

complex c1,c2;

if (c1==c2)

cout << "OK";

else {

cout << "ERROR";

}

}



Answer : A


Question 3

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

#include

using namespace std;

int main()

{

int i = 4;

while(i >= 0) {

cout<

i??;

}

return 0;

}



Answer : A


Question 4

Which code line instead of the comment below will cause the program to produce the expected output?



Answer : C


Question 5

Which code line inserted instead of the comment below will fix the program so that it produces the expected output and does not cause any memory leak?



Answer : A


Page:    1 / 14   
Total 257 questions