C++ Institute CLA - C Certified Associate Programmer CLA-11-03 Question # 11 Topic 2 Discussion

C++ Institute CLA - C Certified Associate Programmer CLA-11-03 Question # 11 Topic 2 Discussion

CLA-11-03 Exam Topic 2 Question 11 Discussion:
Question #: 11
Topic #: 2

Assume that ints and floats are 32-bit wide.

What happens if you try to compile and run this program?

#include

union uni {

float f, g;

int i, j;

};

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

union uni u;

printf ("%ld", sizeof (u) ) ;

return 0;

}

Choose the right answer:


A.

The program outputs 16


B.

The program outputs 8


C.

Compilation fails


D.

The program outputs 4


E.

The program outputs 24


Get Premium CLA-11-03 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.