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 81:

    What will be the output of the program?

    #include

    using namespace std;

    int fun(int);

    int main()

    {

    cout << fun(5);

    return 0;

    }

    int fun(int i)

    {

    return i*i;

    }

    A. 25
    B. 5
    D. 1

  • Question 82:

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

    #include

    using namespace std;

    int main(){

    int i = 1;

    for(i=10; i>-1; i/=2) {

    if(!i)

    break;

    }

    cout << i;

    return 0;

    }

    A. It prints: 0
    B. It prints: 1
    C. It prints: -1
    D. Compilation error

  • Question 83:

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

    #include

    using namespace std;

    int main()

    {

    int x=2, *y;

    y = andx;

    cout << *y + x;

    return 0;

    }

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

  • Question 84:

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

    #include

    #include

    using namespace std;

    class A {

    public:

    int x;

    A() { x=0;}

    A(int x) { this?>x=x;}

    };

    class B : private A {

    public:

    using A::x;

    B() { x=1;}

    B(int x) {this?>x = x;}

    };

    int main () {

    B c1;

    B c2(?5);

    cout << c1.x;

    cout << c2.x;

    return 0;

    }

    A. It prints: 5
    B. It prints: 1?5
    C. It prints: 05
    D. It prints: 0

  • Question 85:

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

    #include

    #include

    using namespace std;

    class A {

    public:

    string s;

    A(string s) { this?>s = s; }

    };

    class B {

    public:

    string s;

    B (A a) { this?>s = a.s; }

    void print() { cout<

    };

    int main()

    {

    A a("Hello world");

    B b=a;

    b.print();

    }

    A. It prints: Hello world
    B. It prints: Hello
    C. Compilation error
    D. None of these

  • Question 86:

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

    A. It prints: 1
    B. It causes a compilation error
    C. It prints: -1
    D. It prints: 0

  • Question 87:

    What will be the output of the program?

    #include

    using namespace std;

    int main()

    {

    const int y = 5;

    const x = ?10;

    cout<

    return 0;

    }

    A. ?10 5
    B. 5 ?10
    C. Compilation error
    D. None of these

  • Question 88:

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

    #include

    using namespace std;

    int mul (int a, int b=2)

    {

    int r;

    r=a*b;

    return (r);

    }

    int main ()

    {

    cout << mul(1) << mul(2,4);

    return 0;

    }

    A. It prints: 2
    B. It prints: 28
    C. It prints: 8
    D. It prints: 6

  • Question 89:

    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.90;

    cout << f << ", ";

    x=f;

    cout << x <<", ";

    f=y;

    cout << f;

    return 0;

    }

    A. It prints: 5, 5, 10.00
    B. It prints: 5.9, 5, 10
    C. It prints: 6, 5, 10
    D. It prints: 6, 5, 10.00

  • Question 90:

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

    A. It prints: 13
    B. It prints: l
    C. It prints: 12
    D. It prints: 2

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.