Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

Answer / 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

a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

Answer / subbu

l=7 is the right answer, which is not given in the options.

Is This Answer Correct ?    10 Yes 8 No

a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

Answer / valli

20 bytes of memory is allocated to s
hence
l=strlen(s);//l=20
so answer is a

Is This Answer Correct ?    2 Yes 14 No

a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

Answer / sivasankar.a

the answer is c)9 because of "etrance"this word lengh is 9.

Is This Answer Correct ?    3 Yes 19 No

Post New Answer

More C Interview Questions

write a c program to find the probability of random numbers between 1-1000

0 Answers   ADS,


A woman had somany gloves and hats 22 red,34 blue, 45 white...there was power cut and she took a glove and how many gloves shud she take so that she gets a pair of glove fr each color??

3 Answers   TCS,


Write a program to show the workingof auto variable.

2 Answers   Infotech,


What is multidimensional arrays

0 Answers  


write a program to find the largest and second largest integer from an array

2 Answers   Value Labs,


How can variables be characterized?

0 Answers  


Which built-in library function can be used to match a patter from the string?

0 Answers  


What is the best way of making my program efficient?

0 Answers  


What are external variables in c?

0 Answers  


write a program in c language for the multiplication of two matrices using pointers?

8 Answers   Ignou,


The variables are int sum=10,SuM=20; these are same or different?

3 Answers  


When should volatile modifier be used?

0 Answers  


Categories