Examveda

What will be the output of the following C code?
#include <stdio.h>
struct p
{
    unsigned int x : 2;
    unsigned int y : 2;
};
int main()
{
    struct p p;
    p.x = 3;
    p.y = 1;
    printf("%d\n", sizeof(p));
}

A. Compile time error

B. Depends on the compiler

C. 2

D. 4

Answer: Option D


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union