Union - C Program

union marks       
    {
        float perc;   
        char grade;   
    }

main ( )
   {
        union marks student1;   
        student1.perc = 98.5;   
        printf( “Marks are %f   address is  %16lu\n”, student1.perc, &student1.perc);  
        student1.grade = ‘A’’;   
        printf( “Grade is  %c  address is  %16lu\n”, student1.grade, &student1.grade);   
   }

Post a Comment

0 Comments