Discussion :: C-MCQs
-
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;
}
Answer : Option D
Explanation :
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
Be The First To Comment