Question
What is the output of the following C code(on a 64 bit machine)?
union Sti
{
int nu;
char m;
};
int main()
{
union Sti s;
printf("%d", sizeof(s));
return 0;
}
union Sti
{
int nu;
char m;
};
int main()
{
union Sti s;
printf("%d", sizeof(s));
return 0;
}
Answer: Option D
Was this answer helpful ?
Since the size of a union is the size of its maximum datatype, here int is the largest hence 4.
Output:
$ cc pgm7.c
$ a.out
4
Was this answer helpful ?
More Questions on This Topic :
Question 5. What is the size of an int data type? ....
Question 10. What is short int in C programming? ....
Submit Solution