C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 18 Topic 2 Discussion

C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 18 Topic 2 Discussion

CPA-21-02 Exam Topic 2 Question 18 Discussion:
Question #: 18
Topic #: 2

What will happen when you attempt to compile and run the following code?

#include

#include

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;

}


A.

It will print: 100


B.

It will print: 101


C.

It will print: 10


D.

It will print: 1


Get Premium CPA-21-02 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.