Halloween Special 2026! Get Up to 25% OFF Practice Questions! Limited Time - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute CPA-21-02 Exam - Topic 5 Question 62 Discussion

Posted by Garry on Oct 25, 2026 at 12:51 AM

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

#include

using namespace std;

int x=5;

static int y=0;

void myFunction(int a)

{

y=++a;

}

int main (int argc, const char * argv[])

{

int i=0;

myFunction(i);

cout<

}

Suggested Answer: C

Get Premium CPA-21-02 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
1 comments · newest first
DY
Dyan 5 days ago
I think the static variable `y` starts at 0, so it might print 0 for that.
0/2000 characters

Save Cancel