What will be the output of the following C code?
#include <stdio.h>
struct p
{
unsigned int x : 7;
unsigned int y : 2;
};
int main()
{
struct p p;
p.x = 110;
p.y = 2;
printf("%d\n", p.x);
}
#include <stdio.h>
struct p
{
unsigned int x : 7;
unsigned int y : 2;
};
int main()
{
struct p p;
p.x = 110;
p.y = 2;
printf("%d\n", p.x);
}A. Compile time error
B. 110
C. Depends on the standard
D. None of the mentioned
Answer: Option B
Related Questions on Structure and Union
Which of the following can be a member of a structure?
A. Function
B. Another structure
C. Enumeration
D. All of the above

Join The Discussion