A memory of 20 bytes is allocated to a string declared as char *sthen the following two statements are executed:s="Etrance"l=strlen(s);what is the value of l ?a.20b.8c.9d.21

C
This question is related to TCS Interview

Showing Answers 1 - 2 of 2 Answers

laxmikanth_rajuri

  • Feb 10th, 2006
 

ans is 8 bos no.of characters in entrance plus 1 additional character whic is null character to indicate end of a string

  Was this answer useful?  Yes

sowmi

  • Jun 6th, 2007
 

strlen() returns the actual length of the string.. it doesn't count the terminal null character.. so the ans is 6

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