Ask Question
30 May, 10:01

Consider the following program where the zu format specifier is used to display as an integer the result of sizeof. #include #include typedef union { int * i1; int * i2; }U; int main () { U temp; int i = 50; temp. i1 = &i; printf ("%zu and %d/n", sizeof (temp), * (temp. i2)); return 0; } What is the output of the program above? Note in the choices below indicates output that isn't any of the literal values in the code above.

+3
Answers (1)
  1. 30 May, 11:51
    0
    4 and 50

    Explanation:

    To answer the question above, we are to first of all consider the size of union will be the max size of datatype in union data. I. E.

    sizeof (int * ) is 4 bytes

    so, sizeof (U) = sizeof (temp) is 4

    and we saved 50 in temp. i1. so, 50 we can access 50 from temp. i2 as well

    so, output is 4 and 50
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Consider the following program where the zu format specifier is used to display as an integer the result of sizeof. #include #include ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers