Home » C Programming » Bit Fields » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct St
    {
    unsigned int c : 2;
    unsigned int n : 2;
    };
    int main()
    {
    struct St s;
    s.c = 13;
    s.n = 10;
    printf("%d\n", s.n);
    }
    1. 10
    2. 13
    3. 2
    4. Garbage value
    5. None of these
Correct Option: C

2



Your comments will be displayed only after manual approval.