Free Online C++ Institute CPA-21-02 Practice Test

Prepare Your C++ Institute CPA-21-02 Exam Questions with Free online CPA-21-02 Practice Test. Get Brilliant CPA C++ Certified Associate Programmer Exam Results with Valid CPA 21-02 Exam Dumps.

Page:    1 / 52      
Total 257 Questions | Updated On: May 15, 2024
Add To Cart
Question 1

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class A
{
public:
virtual void Print()=0;
};
class B:public A
{
public:
virtual void Print(){ cout<< 'B';}
};
int main()
{
B ob2;
A *obj;
obj = &ob2;
obj?>Print();
}


Answer: A
Question 2

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main(){
int i, j;
for(i = 0, j = 1; j < 2, i < 4; i++, j++);
cout << i << ' ' << j;
return 0;
}


Answer: A
Question 3

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
int i = 5;
cout<<'Hello World' << ++i;
return 0;
}


Answer: A
Question 4

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class A
{
public:
virtual void Print()=0;
};
class B:public A
{
public:
virtual void Print(){ cout<< 'B';}
};
int main()
{
B ob2;
A *obj;
obj = &ob2;
obj?>Print();
}


Answer: A
Question 5

What happens when you attempt to compile and run the following code?
#include <iostream>
#include <string>
using namespace std;
class A {
int x;
protected:
int y;
public:
int z;
A() { x=1; y=2; z=3; }
};
class B : public A {
string z;
public:
void set() {
y = 4;
z = 'John';
}
void Print() {
cout << y << z;
}
};
int main () {
B b;
b.set();
b.Print();
return 0;
}


Answer: A
Page:    1 / 52      
Total 257 Questions | Updated On: May 15, 2024
Add To Cart

© Copyrights DumpsCertify 2024. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsCertify.