A memory of 20 bytes is allocated to a string declared as char *s then the following two statements are executed:s="Entrance"l=strlen(s);what is the value of l ?A. 20B. 8C. 9D. 21

This question is related to TCS Interview

Showing Answers 1 - 5 of 5 Answers

deepa

  • Mar 4th, 2006
 

the answer is 9

  Was this answer useful?  Yes

prabha

  • May 22nd, 2006
 

Hi,The answer is 8.

  Was this answer useful?  Yes

Mr X

  • Jun 14th, 2006
 

8 or 9

  Was this answer useful?  Yes

Priya

  • Aug 18th, 2006
 

The answer is 8

StrLen returns the number of characters in a string, NOT counting the terminal null char.

  Was this answer useful?  Yes

Megha Shrivastav

  • Apr 15th, 2007
 

ans is 20

  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