Consider the following structure:struct num nam{int no;char name[25];}struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};..........printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);What does the above statement print?A. 8,9B. 9,9C. 8,8D. 8,unpredictable value

This question is related to TCS Interview

Showing Answers 1 - 4 of 4 Answers

nagesh k

  • Aug 18th, 2006
 

n1[2].no in the above quetion is 8. (*(n1+2).no) is also same as n1[2].no hence result is 8,8+1 i.e 8,9

  Was this answer useful?  Yes

lava

  • Dec 28th, 2006
 

A. 8,9But the printf needs to be this way...printf("%d%d",n1[2].no,(*(n1 + 2)).no + 1);

  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