Home » C Programming » Bit Fields » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct Stru
    {
    unsigned int x : 7;
    unsigned int y : 2;
    };
    int main()
    {
    struct Stru s;
    s.x = 110;
    s.y = 2;
    printf("%d\n", s.x);
    }
    1. 7
    2. 2
    3. Compilation Error
    4. Garbage value
    5. 110
Correct Option: E

None of these



Your comments will be displayed only after manual approval.