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

Answer Posted / fazlur rahaman naik

the string is Entrance or Etrance?
if it is Entrance,then only the answer is here.

b is the right answer.

because string length means it will count only the no.of
characters in that string only...not the null character.

Is This Answer Correct ?    23 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is %lu in c?

671


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

627


Write a simple code fragment that will check if a number is positive or negative.

700


How can I direct output to the printer?

803


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2211






What is c standard library?

687


please give me some tips for the placement in the TCS.

1622


What is the code for 3 questions and answer check in VisualBasic.Net?

1682


What are the types of pointers in c?

524


What is the advantage of c?

607


Why isn't any of this standardized in c? Any real program has to do some of these things.

615


How can I read in an object file and jump to locations in it?

567


What is an arrays?

646


What is the difference between array and pointer?

560


What is bss in c?

592