1.

What will be the output of the following C code?
#include <stdio.h>
union Un
{
struct str
{
unsigned char ch : 2;
unsigned int n : 2;
};
int ch;
};
int main()
{
union Un u;
Un.str.ch = 2;
printf("%d n", Un.str.ch);
}

A. Compilation Error
B. Garbage value
C. 2
D. Nothing
E. None of these
Answer» B. Garbage value


Discussion

No Comment Found

Related MCQs