A
Q. In the following C code, the union size is decided by?
union temp { char ch; int n; float f; };
The correct answer is:
✅ (A) float
Explanation:
How is Union Size Determined?
Example Code:
#include <stdio.h>
union temp {
char ch;
int n;
float f;
};
int main() {
printf("Size of union: %lu\n", sizeof(union temp));
return 0;
}
Expected Output:
Size of union: 4
(If there's padding, it might be 8 bytes on some architectures.)
Final Answer:
✅ (A) float
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. What will be the output of the following C code?
Q. What will be the output of the following code snippet?
Q. What is the output of this C code?
Q. The concept of two functions with same name is know as?
Q. To develop which operating, C language was invented?
Q. C99 standard guarantees uniqueness of __________ characters for internal names.
Q. What will be the output of the following statement ?
Q. What will be output for the following code?
Q. What is the output of Left Shift Operator << on (00011000<<2).?
Discusssion
Login to discuss.