Vidyalelo
C Programming · Q146

Structure and Union

Programming · C Programming · question 146

Q146

What will be the output of the following C code? #include struct p char x : 2; int y : 2; ; int main() struct p p; p.x = 2; p.y = 1; p.x = p.x & p.y; printf("%d ", p.x);

A.
0
Answer
B.
Compile time error
C.
Undefined behaviour
D.
Depends on the standard

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board