Official Bank 0/220

C++ Certified Associate Programmer (CPA) - CPPL Actual Exam Questions

Last updated on May 02, 2026

97% Exam Compliance
220 Total Questions
1
Question

What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; int op(int x, int y); int main() { float *pf; float f=0.9; pf=&f; cout << op(1, *pf); return 0; } int op(int x, int y) { return x*y; }

Options
A

It prints: 0

B

It prints: 0.5

C

It prints: 1

D

It prints: ?1

Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

2
Question

What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class A { public: virtual void Print(){ cout<<"A";} }; class

Options
A

It prints: AB

B

public A { public: void Print(){ cout<< "B";} }; int main() { A *obj; A ob1; obj = &ob1; obj?>Print(); B ob2; obj = &ob2; obj?>Print(); }

C

It prints: AA

D

It prints: BA

E

It prints: BB

Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

3
Question

What happens when you attempt to compile and run the following code? #include <iostream> 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; }

Options
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

Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

4
Question

What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class First { public: First() { cout << "Constructor";} ~First() { cout << "Destructor";} void Print(){ cout<<"from First";} }; int main() { First FirstObject; FirstObject.Print(); }

Options
A

It prints: Constructorfrom First

B

It prints: Constructorfrom FirstDestructor

C

It prints: Constructorfrom FirstDestructorDestructor

D

Compilation error at line 16

Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

5
Question

What will be the output of the program? #include <iostream> using namespace std; int main() { const int y = 5; const x = ?10; cout<<x<<" "<<y; return 0; }

Options
A

?10 5

B

5 ?10

C

Compilation error

D

None of these

Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

Finish Practice?

Are you sure you want to finish? This will end your practice session.