Home/c institute/Free C++ Institute CPA Actual Exam Questions

Free C++ Institute CPA Actual Exam Questions

The questions for this exam were last updated on January 7, 2026

Dumps Box (DumpsBox) offers up-to-date practice exam questions for CPA certification exam which are developed and validated by C++ Institute subject domain experts certified in C++ Institute CPA . These practice questions are update regularly as we keep an eye on any recent changes in CPA syllabus, and when there is update our team quickly adjusts the questions. This commitment to providing the best quality exam prep material to certification aspirants is what makes DumpsBox.com the best certification exam prep website. On top of that, our strong, yet strictly moderated, community based feedback keeps the content clean and current. Each question has helpful community discussion that provides it extra perspective and introduces helpful resources for better exam preparation. This also saves students from other outdated practice questions or illicit exam dumps that can have adverse affects on career. Browse through our C++ Institute CPA exam questions and pass your exam on first try.

Question No. 1
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(1), y(2), z(0) { 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;
}
Select one option, then reveal solution.
Question No. 2
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int fun(int x);
int main() {
cout << fun(0); return 0; } int fun(int x) { if(x > 0)
return fun(x-1);
else
return 100;
}
Select one option, then reveal solution.
Question No. 3
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main(int argc, char *argv[]) {
char *s = "ABCDEF";
cout << s+2;
return 0;
}
Select one option, then reveal solution.
Question No. 4
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A
{
public:
void Print(){ cout<<"A";} }; class B:public A { public: void Print(){ cout<< "B";} }; int main() { A *obj; A ob1; obj = &ob1; obj?>Print();
B ob2;
obj = &ob2;
obj?>Print();
}
Select one option, then reveal solution.
Question No. 5
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
public:
A() { cout << "A0 ";}
A(string s) { cout << "A1";}
};
class B : public A {
public:
B() { cout << "B0 ";}
B(string s) { cout << "B1 ";}
};
class C : private B {
public:
C() { cout << "C0 ";}
C(string s) { cout << "C1 ";}
};
int main () {
B b1;
C c1;
return 0;
}
Select one option, then reveal solution.
Question No. 6
What is the output of the program given below?
#include
using namespace std;
int main (int argc, const char * argv[])
{
int i=10;
{
int i=0;
cout<}
{
int i=5;
cout << i;
}
cout<return 0;
}
Select one option, then reveal solution.
Question No. 7
Which code, inserted at line 10, generates the output "Hello World"?
#include
#include
using namespace std;
string fun(string, string);
int main()
{
string s="Hello";
string *ps;
ps = &s;
//insert code here
return 0;
}
string fun(string s1, string s2)
{
return s1+s2;
}
Select one option, then reveal solution.
Question No. 8
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A {
public :
void print() {
cout << "A "; } }; class B { public : void print() { cout << "B "; } }; int main() { B sc[2]; A *bc = (A*)sc; for (int i=0; i<2;i++) (bc++)->print();
return 0;
}
Select one option, then reveal solution.
Question No. 9
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main (int argc, const char * argv[])
{
int a = 30, b = 1, c = 5, i=10;
i = b < a < c;
cout << i;
return 0;
}
Select one option, then reveal solution.
Question No. 10
What is the output of the program?
#include
using namespace std;
int main()
{
int tab[4]={10,20,30,40};
tab[1]=10;
int *p;
p=&tab[0];
cout<<*p;
return 0;
}
Select one option, then reveal solution.
Question No. 11
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int *a= new int;
*a=100;
cout << *a;
delete a;
}
Select one option, then reveal solution.
Question No. 12
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
struct Person {
string name;
int age;
};
class First
{
Person *person;
public:
First() {person = new Person;
person?>name = "John";
person?>age = 30;
}
void Print(){
cout<name << " "<< person?>age;
}
};
int main()
{
First t[2];
for (int i=0; i<2; i++)
t[i].Print();
}
Select one option, then reveal solution.
Question No. 13
What is the output of the program given below?
#include
using namespace std;
int main (int argc, const char * argv[])
{
enum state { ok, error, warning};
enum state s1, s2, s3, s4;
s1 = ok;
s2 = warning;
s3 = error;
s4 = ok;
cout << s1<< s2<< s3<< s4;
return 0;
}
Select one option, then reveal solution.
Question No. 14
What is the output of the program?
#include
using namespace std;
class BaseC
{
int i;
public:
BaseC() { i=?1;}
BaseC(int i) { i=i; }
void seti(int a) { i = a; };
void Print() { cout << i; } }; int main() { BaseC *o = new BaseC(); o?>seti(10);
o?>Print();
}
Select one option, then reveal solution.
Question No. 15
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();
}
Select one option, then reveal solution.