Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Step 3: Execute the following modified version of the program from step 1. Ident

ID: 3639075 • Letter: S

Question

Step 3: Execute the following modified version of the program from step 1. Identify the variables that have been created but not destroyed when the cout statement in the function fun4 is executed. What is the scope of each? what is the value of each?

#include <iostream>
using namespace std;

void fun4();
void fun3();

int main() {

char x;

x = 'Z';
cout << " x = " << x << endl;
fun3();
cout << " x = " << x << endl;

return (0);
}

void fun4()
{
char x;
x = 'Y';
cout << x << "ou bet it's cold! ";
}

void fun3()
{
char x;
x = 'H';
cout << x << "ey Fargo is in North Dakota not Texas! ";
fun4();
}

Explanation / Answer

in the form scope::name = value main::x = 'Z' fun3::x = 'H' fun4::x = 'Y'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote