ProAnswers.org

can we perform operations like addition using unions?if possible how can we perform

Yes, we can perform operation sing unions. Like this

#include

union uni1

{

       int first_union;

}u1;

union uni2

{

     int second_union;

}u2;

int main()

{

           u1.first_union=6;

           u2.second_union=4;

           printf("%d",u1.first_union+u2..second_union);

}