http://amzn.to/2kpkwZx

what is the output in a c program?


Kirti    Fri Mar 22 19:22:52 IST 2013


union u 
{ 
struct st 
{ 
int i : 4; int j : 4; int k : 4; int l; 
}
st; int i; 
}
u; main()
 {
 u.i = 100; 
printf("%d, %d, %d",u.i, u.st.i, u.st.l); }


Reply By- Anoop kumar awasthi    Fri Mar 22 22:49:26 IST 2013


The output of this program is 100,4,0 . Because first "i" is the variable inside in union so we use it by union reference and second struct reference is access by union reference and struct reference call the i inside of struct. The value of l is print 0 because the variable declared inside of struct bydefault 0.


Reply By- CharlesPem    Fri Mar 17 04:46:33 IST 2017


on


Reply By- AlfredWiday    Fri Mar 17 04:51:32 IST 2017


on


Reply By- AlfredWiday    Fri Mar 17 07:23:29 IST 2017


on


Reply By- BennyKit    Fri Mar 17 17:13:55 IST 2017


on


Reply By- BennyKit    Fri Mar 17 22:37:37 IST 2017


on


Reply By- Kennethkib    Sat Mar 18 00:01:42 IST 2017


on


Reply By- Kennethkib    Sat Mar 18 02:26:51 IST 2017


on


Reply By- MichaelVoine    Sat Mar 18 05:13:41 IST 2017


on


Reply By- AlfredWiday    Sat Mar 18 05:37:28 IST 2017


on


Reply By- CharlesPem    Sat Mar 18 09:16:10 IST 2017


on


Reply By- Kennethkib    Sat Mar 18 12:18:59 IST 2017


on


Reply By- BennyKit    Sat Mar 18 13:30:52 IST 2017


on


Reply By- BennyKit    Sat Mar 18 17:52:38 IST 2017


on


Reply By- AlfredWiday    Sat Mar 18 23:05:26 IST 2017


on


Reply By- EugeneSok    Sat Mar 18 23:08:33 IST 2017


on


Reply By- AaronlAt    Sun Mar 19 09:07:01 IST 2017


on


Reply By- BennyKit    Sun Mar 19 12:22:10 IST 2017


on


Reply By- AaronlAt    Sun Mar 19 16:02:46 IST 2017


on


Reply By- BennyKit    Sun Mar 19 22:43:47 IST 2017


on


Reply By- CharlesPem    Sun Mar 19 23:33:31 IST 2017


on


Reply By- AlfredWiday    Sun Mar 19 23:45:31 IST 2017


on