Last Update 19 hours ago Total Questions : 257
The CPA - C++ Certified Associate Programmer content is now fully updated, with all current exam questions added 19 hours ago. Deciding to include CPA-21-02 practice exam questions in your study plan goes far beyond basic test preparation.
You'll find that our CPA-21-02 exam questions frequently feature detailed scenarios and practical problem-solving exercises that directly mirror industry challenges. Engaging with these CPA-21-02 sample sets allows you to effectively manage your time and pace yourself, giving you the ability to finish any CPA - C++ Certified Associate Programmer practice test comfortably within the allotted time.
What happens when you attempt to compile and run the following code?
#include < iostream >
using namespace std;
int main(){
int i = 1;
if (i==1) {
cout < < i;
} else {
cout < < i-1;
}
return 0;
}
What happens when you attempt to compile and run the following code?
#include < iostream >
using namespace std;
int main(int argc, char *argv[]) {
char *s = " ABCDEF " ;
cout < < s+2;
return 0;
}
What happens when you attempt to compile and run the following code?
#include < iostream >
using namespace std;
int main()
{
int i=2;
switch(i)
{
case 1:
cout < < " Hello " ;
break;
case 2:
cout < < " world " ;
break;
case 3:
printf( " End " );
break;
}
return 0;
}
What will happen when you attempt to compile and run the following code?
#include < iostream >
#include < string >
using namespace std;
int fun(int);
int main()
{
int *x = new int;
*x=10;
cout < < fun(*x);
return 0;
}
int fun(int i)
{
return i*i;
}
Which of the following operators accept integer arguments only? (Choose two.)
Which of the following statements are correct about an array?
int tab[10];
What happens when you attempt to compile and run the following code?
#include < iostream >
using namespace std;
int main (int argc, const char * argv[])
{
int tab[5]={1,2,3};
for (int i=0; i < 5; i++)
cout < < tab[i];
return 0;
}
What happens when you attempt to compile and run the following code?
#include < iostream >
#include < string >
using namespace std;
class complex{
double re, im;
public:
complex() : re(1),im(0.3) {}
complex(double n) { re=n,im=n;};
complex(int m,int n) { re=m,im=n;}
complex operator+(complex & t);
void Print() { cout < < re < < " " < < im; }
};
complex complex::operator+ (complex & t){
complex temp;
temp.re = this? > re + t.re;
temp.im = this? > im + t.im;
return temp;
}
int main(){
complex c1(1),c2(2),c3;
c3 = c1 + c2;
c3.Print();
}
What will be the output of the program?
#include < iostream >
using namespace std;
int main()
{
int i=0;
for(; i < =5; i++)
cout < < i;
return 0;
}
What is the output of the program?
#include < iostream >
#include < string >
using namespace std;
int main()
{
string s1[]= { " H " , " t " };
string s;
for (int i=0; i < 2; i++) {
s = s1[i];
s.insert(1, " ow " );
cout < < s;
}
return( 0 );
}
