Complete the code to declare a union named Data.
union [1] {
int i;
float f;
};The keyword union is followed by the union name. Here, Data is the correct union name.
Complete the code to access the integer member of the union variable d.
union Data d; d.[1] = 10;
To access the integer member of the union, use the member name i.
Fix the error in the union initialization.
union Data d = [1];In C, to initialize a union member by name, use the designated initializer syntax like {.i = 3}.
Fill both blanks to create a union variable and assign a float value.
union Data [1]; [2].f = 5.5;
The variable name must be consistent. Here, d is used both to declare and access the union variable.
Fill all three blanks to create a union, declare a variable, and assign an integer value.
union [1] { int i; float f; } [2]; [3].i = 42;
The union is named Data, the variable declared is d, and we assign to d.i.
