Want to pass your CPA - C++ Certified Associate Programmer CPA-21-02 exam in the very first attempt? Try Pass2lead! It is equally effective for both starters and IT professionals.
VCE
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A
{
public:
virtual void Print(){ cout<<"A";}
};
class B:public A
{
public:
virtual void Print(){ cout<< "B";}
};
int main()
{
A *obj;
A ob1;
obj = andob1;
obj?>Print();
B ob2;
obj = andob2;
obj?>Print();
}
A. It prints: AB
B. It prints: AA
C. It prints: BA
D. It prints: BB
What happens when you attempt to compile and run the following code?

A. It prints: 33
B. It prints: ?1
C. It prints: ??
D. It prints: ?3
What will be the output of the program?
#include
#include
using namespace std;
int fun(int);
int main()
{
float k=3;
k = fun(k);
cout< return 0; } int fun(int i) { i++; return i; } A. 3 B. 5 C. 4 D. 5