What is the output of the program, if integer occupies 2 bytes memory?union{int a;char b;char c[10];}u1;void main(){int l=sizeof(u1);printf("%d",l);getch();}A. 13B. 10C. 16D. None of the above

B

This question is related to Oracle Interview

Showing Answers 1 - 21 of 21 Answers

Bruce

  • Nov 7th, 2006
 

D, It must 12 (the maximum is 10 but it had plus 2 (cause bounded memory)).

  Was this answer useful?  Yes

Amarjeet Agrawal

  • Sep 8th, 2015
 

The right ans is 10 becoz as elements of the union allocates the largest memory.

  Was this answer useful?  Yes

Nisha Sharma

  • Sep 21st, 2015
 

13

  Was this answer useful?  Yes

roshani

  • Sep 22nd, 2015
 

B. 10

  Was this answer useful?  Yes

Mani Prakash Singh

  • Oct 17th, 2015
 

10

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions