Home / C Programming / Structures, Unions, Enums :: Discussion

Discussion :: Structures, Unions, Enums

  1. Which of the following statements correct about the below program?

     #include
      int main() 
      {   
          union a   
          {       
              int i;       
              char ch[2];     
         };  
         union a u1 = {512};   
         union a u2 = {0, 2};   
         return 0;
     } 

     

    1: u2 CANNOT be initialized as shown.
    2: u1 can be initialized as shown.
    3: To initialize char ch[] of u2 '.' operator should be used.
    4: The code causes an error 'Declaration syntax error'

     

  2. A.

    1, 2

    B.

    2, 3

    C.

    1, 2, 3

    D.

    1, 3, 4

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment