The following C program uses a combination of global variables and local variables with different scope. What is the output? #include int t = 1; // Global variable int sub1(int fluff); int main (void)...



The following C program uses a combination of global variables and


local variables with different scope. What is the output?


#include

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);


{


z = t;


t = 3;


{


int t = 4;


z = t;


z = z + 1;


printf("B: The variable z equals %d\n", z);


}


z = sub1(z);


z = z + 1;


printf("C: The variable z equals %d\n", z);


}


z = t;


z = z + 1;


printf("D: The variable z equals %d\n", z);


}


int sub1(int fluff)


{


int i;


i = t;


return (fluff + i);


}



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here