The following C program uses a combination of global variables and
local variables with different scope. What is the output?
int t = 1; // Global variable
int sub1(int fluff);
int main (void)
{
int t = 2;
int z;
z = t;
z = z + 1;
printf("A: The variable z equals %d\n", z);
t = 3;
int t = 4;
printf("B: The variable z equals %d\n", z);
}
z = sub1(z);
printf("C: The variable z equals %d\n", z);
printf("D: The variable z equals %d\n", z);
int sub1(int fluff)
int i;
i = t;
return (fluff + i);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here