Free C++ Institute CPA Exam Dumps Questions & Answers
| Exam Code/Number: | CPAJoin the discussion |
| Exam Name: | C++ Certified Associate Programmer |
| Certification: | C++ Institute |
| Free Question Number: | 220 |
| Publish Date: | Oct 31, 2026 |
| # of views: | 7106 |
|
|
|
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int op(int x, int y)
{
return x?y;
}
int op(int x, float y)
{
return x+y;
}
int main()
{
int i=1, j=2, k, l;
float f=0.23;
k = op(i, j);
l = op(j, f);
cout<< k << "," << l;
return 0;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
const int x=20;
const int *ptr;
ptr = &x;
*ptr = 10;
cout<<*ptr;
return 0;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
const int x=0;
const int *ptr;
ptr = &x;
cout<<*ptr;
return 0;
}
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;
}
If there is one, point out an error in the program
#include <iostream>
using namespace std;
int main() {
int c = 'a';
switch(i)
{
case '2':
cout<<"OK";
case '1':
cout<<"Error";
default:
break;
}
return 0;
}
| CPA Dumps Other Version | QA's | Publish Date |
| C++Institute.CPA.v2022-02-18.q137 | 137 | Feb 18, 2022 |