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);
}
int fun(int x) {
if(x > 0)
return fun(x-1);
else
return 100;
}
A. It prints: 0What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int i = 4;
while(i >= 0) {
cout<
i??;
}
return 0;
}
A. It prints:"43210"What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class complex{
double re, im;
complex() : re(1),im(0.4) {}
complex operator?(complex andt);
void Print() { cout << re << " " << im; }
};
complex complex::operator? (complex andt){
complex temp;
temp.re = this?>re ? t.re;
temp.im = this?>im ? t.im;
return temp;
}
int main(){
complex c1,c2,c3;
c3 = c1 ? c2;
c3.Print();
}
A. It prints: 1 0.4What 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();
}
A. It prints: 10What is the expected result of the following program?

What happens when you attempt to compile and run the following code?
#include
using namespace std;
class Test {
float i,j;
};
class Add {
public:
int x,y;
Add (int a=3, int b=3) { x=a; y=b; }
int result() { return x+y;}
};
int main () {
Test test;
Add * padd;
padd = andtest;
cout << padd?>result();
return 0;
}
A. It prints: 6What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class complex{
double re, im;
public:
complex() : re(1),im(0.4) {}
complex operator+(complex andt);
void Print() { cout << re << " " << im; }
};
complex complex::operator+ (complex andt){
complex temp;
temp.re = this?>re + t.re;
temp.im = this?>im + t.im;
return temp;
}
int main(){
complex c1,c2,c3;
c3 = c1 + c2;
c3.Print();
}
A. It prints: 1 0.4What 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=andtab[0];
cout<<*p;
return 0;
}
A. It prints: 10What is the output of the program?
#include
#include
using namespace std;
struct t
{
int tab[2];
};
class First
{
struct t u;
public:
First() {
u.tab[0] = 1;
u.tab[1] = 0;
}
void Print(){
cout << u.tab[0] << " " << u.tab[1];
}
};
int main()
{
First t;
t.Print();
}
A. It prints: 2 2What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
inline float sum(float a,float b)
{
return a+b;
}
int main()
{
float a,b;
a = 1.5; b = 3.4;
cout< return 0; }
B. It prints: 4.9
C. It prints: 5
D. It prints: 4
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.