Examveda

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);
}

A. Compile time error

B. 110

C. Depends on the standard

D. None of the mentioned

Answer: Option B


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union