Home / C Programming / Memory Allocation :: Discussion

Discussion :: Memory Allocation

  1. What will be the output of the program?

     #include
     #include 
     
      int main() 
      {    
          union test    
          {      
               int i;     
               float f;     
               char c;    
         };   
         union test *t;    
         t = (union test *)malloc(sizeof(union test));   
         t->f = 10.10f;     
         printf("%f", t->f);    
         return 0;
       } 
    

  2. A.

    10

    B.

    Garbage value

    C.

    10.100000

    D.

    Error

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment