CPA-21-02 Exam Details

  • Exam Code
    :CPA-21-02
  • Exam Name
    :CPA - C++ Certified Associate Programmer
  • Certification
    :C++ Institute Certifications
  • Vendor
    :C++ Institute
  • Total Questions
    :257 Q&As
  • Last Updated
    :May 30, 2026

C++ Institute CPA-21-02 Online Questions & Answers

  • Question 101:

    What happens if you try to compile and run this program?

    #include

    using namespace std;

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

    {

    print("Test");

    return 0;

    }

    void print(int c[])

    {

    cout<

    }

    A. It prints: Test
    B. Compilation fails
    C. Program terminates abnormally
    D. None of these

  • Question 102:

    A condition expression used by if(), while(), and do-while() must evaluate to and only to:

    A. an int type value
    B. any value that can be treated as truth/falsehood
    C. a float type value
    D. a bool type value

  • Question 103:

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

    #include

    using namespace std; int main()

    {

    int i = 5;

    cout<<"Hello World" << ++i;

    return 0;

    }

    A. It prints: Hello World6
    B. It prints: Hello
    C. It prints: World
    D. It prints: Hello World5

  • Question 104:

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

    #include

    using namespace std;

    void fun(int*);

    int main()

    {

    int i=2;

    fun(andi);

    cout<

    return 0;

    }

    void fun(int *i)

    {

    *i = *i**i;

    }

    A. It prints: 1
    B. It prints: 4
    C. It prints: 10
    D. It prints: 0

  • Question 105:

    Analyze the code below. If it contains an error, indicate its place in the program.

    A. Error in the for loop
    B. Error in the break statement
    C. No error
    D. Error in the if statement

  • Question 106:

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

    #include

    using namespace std;

    int main()

    {

    int x,y=10;

    float f;

    f = 5.20;

    x=(int) f;

    cout << x <<", ";

    f=float (y);

    cout << f;

    return 0;

    }

    A. It prints: 5, 10
    B. It prints: 5.2, 10
    C. It prints: 5.20, 10.0
    D. It prints: 5.2, 10.00

  • Question 107:

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

    #include

    #include

    using namespace std;

    class A {

    public:

    A() { cout << "A no parameters";}

    A(string s) { cout << "A string parameter";}

    A(A anda) { cout << "A object A parameter";}

    };

    class B : public A {

    public:

    B() { cout << "B no parameters";} B(string

    s) { cout << "B string parameter";} };

    int main () {

    A a2("Test");

    B b1("Alan");

    B b2(b1);

    return 0;

    }

    A. It prints: A no parametersA no parametersB string parameter
    B. It prints: A string parameterA no parametersB string parameterA object A parameter
    C. It prints: A no parametersB string parameter
    D. It prints: A no parametersA no parameters

  • Question 108:

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

    #include

    using namespace std;

    void fun(int andi);

    int main()

    {

    int i=2;

    fun(i);

    cout<

    return 0;

    }

    void fun(int andi)

    {

    i+=2;

    }

    A. It prints: 2
    B. It prints: 0
    C. It prints: 4
    D. It prints: 16

  • Question 109:

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

    #include

    using namespace std;

    int fun(int x) {

    return x<<2;

    }

    int main(){

    int i;

    i = fun(1) / 2;

    cout << i;

    return 0;

    }

    A. It prints: 0
    B. It prints: 1
    C. It prints: 2
    D. It prints: 4

  • Question 110:

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

    #include

    using namespace std;

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

    {

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

    for (int i=0; i<5; i++)

    cout <

    return 0;

    }

    A. compilation fails
    B. It prints: 12300
    C. It prints: 12345
    D. It prints: 00000

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only C++ Institute exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your CPA-21-02 exam preparations and C++ Institute certification application, do not hesitate to visit our Vcedump.com to find your solutions here.