What will be the output of the following code −
#include
#include
int main() {
union my_union {
int i;
float f;
char c;
};
union my_union* u;
u = (union my_union*)malloc(sizeof(union my_union));
u->f = 20.60f;
prin
Answer: B
Using unions, we can use same memory location to hold multiple type of data. All member of union uses same memory location which has maximum space. Here float is used, which has 20.60f = 20.600000.