CPA 무료 덤프문제 온라인 액세스
| 시험코드: | CPA |
| 시험이름: | C++ Certified Associate Programmer |
| 인증사: | C++ Institute |
| 무료 덤프 문항수: | 220 |
| 업로드 날짜: | 2026-05-29 |
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int x=5;
static int y;
int i=0;
void static myFunction()
{
y=x++ + ++i;
}
int main (int argc, const char * argv[])
{
x++;
myFunction();
cout<<y<<" "<<x<< " " << i;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
void fun(int*);
int main()
{
int *x;
int i=2;
x=&i;
fun(x);
cout<<i;
return 0;
}
void fun(int *i)
{
*i = *i * *i;
}
What is the output of the program?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1="World";
string s2;
s2="Hello" + s1;
cout << s2;
return( 0 );
}
What will happen when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int getValue();
int main()
{
const int x = getValue();
cout<<x;
return 0;
}
int getValue()
{
return 5;
}
What happens if character 3 is entered as input?
#include <iostream>
using namespace std;
class A {
public:
int i;
};
int main () {
int c;
A obj;
obj.i = 5;
cin >> c;
try
{
switch (c)
{
case A: throw 20;
case B: throw 5.2f;
case C: throw obj;
default: cout<<"No exception";
}
}
catch (int e)
{ cout << "int exception. Exception Nr. " << e; }
catch (A e)
{ cout << "object exception. Exception Nr. " << e.i; }
catch (...)
{ cout << "An exception occurred."; }
return 0;
}