C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 4 Topic 1 Discussion

C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 4 Topic 1 Discussion

CPA-21-02 Exam Topic 1 Question 4 Discussion:
Question #: 4
Topic #: 1

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

#include

#include

using namespace std;

void fun(int i);

int main()

{

int i=0;

i++;

for (i=0; i<=5; i++)

{

fun(i);

}

return 0;

}

void fun(int i)

{

if (i==3)

return;

cout << i;

}


A.

It prints: 05


B.

It prints: 012345


C.

It prints: 01245


D.

It prints: 0


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.