C Programming MCQ

1:

Assuming that bit-fields are accomodated from right to left and word size is 16-bits

Consider the declaration
     static struct {
                              unsigned a : 5;
                              unsigned b : 5;
                              unsigned c : 5;
                              unsigned d : 5;
                           } v =  (1, 2, 3, 4); 

Consider the declaration

    struct wer {
                          unsigned a :  5;
                          unsigned : 0;
                          unsigned b : 3;
                          unsigned : 0;
                          unsigned c : 2 ;
                          unsigned : 0 ;
                          } v;

The storage needed for v is
A.

1 word

B.

2 words

C.

3 words

D.

4 words

 

Answer : C

Explanation :

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.