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
    :Jan 13, 2026

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

  • Question 1:

    Which of the following operations is INCORRECT?

    A. int i=15;
    B. long int k=123
    C. float f=12,2;
    D. double d=12;

  • Question 2:

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

    #include

    using namespace std;

    void print(char *c);

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

    {

    print("Test");

    return 0;

    }

    void print(char *c)

    {

    cout<

    }

    A. It prints: Test
    B. It prints: T
    C. It prints: st
    D. None of these

  • Question 3:

    How many times will the program print "HELLO" ?

    #include

    using namespace std;

    int main()

    {

    cout<<"HELLO";

    main();

    return 0;

    }

    A. 65536
    B. 32769
    C. 1
    D. Till stack overflows

  • Question 4:

    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(2), y(2), z(1) { z = x + y; }

    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;

    b.Print();

    return 0;

    }

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

  • Question 5:

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

    #include

    #include

    using namespace std;

    string fun(string, string);

    int main()

    {

    string s="Hello";

    cout << fun(s, " World");

    return 0;

    }

    string fun(string s1, string s2)

    {

    return s1+s2;

    }

    A. It will print: Hello World
    B. It will print: Hello
    C. It will print: World
    D. It will print: HW

  • Question 6:

    Which of the following is a user defined data type?

    1:

    struct person

    {

    char name[20];

    int age;

    };

    2:

    int l=2;

    3:

    enum color {red,blue, green};

    A. 1
    B. 2
    C. 3
    D. 4

  • Question 7:

    Which of the following operators accept integer arguments only? (Choose two.)

    A. |
    B. | |
    C. ~
    D. !

  • Question 8:

    Which code, inserted at line 12, generates the output "5b"? #include using namespace std; namespace myNamespace1 { int var = 5; } namespace myNamespace2 { char var = 'b'; } int main () { //insert code here return 0; }

    A. cout
    B. cout
    C. cout
    D. None of these

  • Question 9:

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

    A. It prints: BAD
    B. It prints: BACD
    C. It prints: ABCD
    D. It prints: BAC

  • Question 10:

    Which of the following structures are correct?

    1:

    struct s1{

    int x;

    char c;

    };

    2:

    struct s2{

    float f;

    struct s2 *s;

    };

    3:

    struct s3{

    float f;

    in i;

    }

    A. 1
    B. 2
    C. 3
    D. All of these

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.