Sunday, 4 January 2015

Programming Quiz-50



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);
}

a. 4, 4, 0
b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0 


Answer: C

No comments:

Post a Comment