Examveda

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

A. 1

B. 2

C. 0

D. Depends on the compiler

Answer: Option C


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union